Steps to replicate the issue (include links if applicable):
- Install both the mentioned below versions of MediaWiki, FlaggedRevs and PageForms
- Create a form that saves a page
- Save a page through the form
- Hook in FlaggedRevs gets hit from [0]
- TypeError happens in FlaggedRevs
What happens?:
I get a type error in the FlaggedRevs FlaggablePageView class where it assumes the $sectionanchor is always a string, not null. The same thing applies to $extraQuery too.
What should have happened instead?:
The page should save without a TypeError
Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):
MediaWiki 1.43 (installed from official tarball)
PageForms: 5.8.1 (0b984cc)
FlaggedRevs: REL1_43 (e5c78a2)
Other information (browser name/version, screenshots, etc.):
Stacktrace:
2025-09-01 18:54:55 [bbd282aab71d9c0b99e1fe3b] /Special:FormEdit/ExternalMediaLinks
TypeError: FlaggablePageView::injectPostEditURLParams(): Argument #1 ($sectionAnchor) must be of type string, null given, called in /extensions/FlaggedRevs/includes/frontend/FlaggedRevsUIHooks.php on line 840
#0 /extensions/FlaggedRevs/includes/frontend/FlaggedRevsUIHooks.php(840): FlaggablePageView->injectPostEditURLParams()
#1 /includes/HookContainer/HookContainer.php(159): FlaggedRevsUIHooks->onArticleUpdateBeforeRedirect()
#2 /extensions/PageForms/includes/PF_AutoeditAPI.php(519): MediaWiki\HookContainer\HookContainer->run()
#3 /extensions/PageForms/includes/PF_AutoeditAPI.php(1032): PFAutoeditAPI->doStore()
#4 /extensions/PageForms/includes/PF_AutoeditAPI.php(130): PFAutoeditAPI->doAction()
#5 /extensions/PageForms/specials/PF_FormEdit.php(113): PFAutoeditAPI->execute()
#6 /extensions/PageForms/specials/PF_FormEdit.php(54): PFFormEdit->printForm()
#7 /includes/specialpage/SpecialPage.php(728): PFFormEdit->execute()
#8 /includes/specialpage/SpecialPageFactory.php(1717): MediaWiki\SpecialPage\SpecialPage->run()
#9 /includes/actions/ActionEntryPoint.php(504): MediaWiki\SpecialPage\SpecialPageFactory->executePath()
#10 /includes/actions/ActionEntryPoint.php(146): MediaWiki\Actions\ActionEntryPoint->performRequest()
#11 /includes/MediaWikiEntryPoint.php(200): MediaWiki\Actions\ActionEntryPoint->execute()
#12 /index.php(58): MediaWiki\MediaWikiEntryPoint->run()
#13 {main}I have reported this here since the hook definition in MW core [1] says it should be a string, if this is the wrong place to report this issue please move it to the right place.
[0] https://gerrit.wikimedia.org/g/mediawiki/extensions/PageForms/+/0b984cc02ff91bffb9b92c83b7d6814584a31a68/includes/PF_AutoeditAPI.php#519
[1] https://gerrit.wikimedia.org/g/mediawiki/core/+/509a2491ef87e50a32bfdcc987bfc3e2cefb5598/includes/Hook/ArticleUpdateBeforeRedirectHook.php#26