Page MenuHomePhabricator

PageForms: Without {{{for template}}} form submission silently fails
Open, Needs TriagePublic

Description

If the {{{for template}}} stanza is omitted, Form submission will fail without an error -- the user will be retuned to the form. If {{{for template}}} is included, but no template is specified, a PHP FATAL is thrown. Below is what is displayed for E_ALL when display errors is set:

Notice: Undefined offset: 1 in /var/www/html/extensions/PageForms/includes/PF_FormPrinter.php on line 929
Exception encountered, of type "Error"
[f9d2626f8a126918be0ef15b] [no req] Error from line 976 of .../extensions/PageForms/includes/PF_FormPrinter.php: Call to a member function setFieldValuesFromSubmit() on null
Backtrace:
#0 .../includes/StubObject.php(105): PFFormPrinter->formHTML(string, boolean, boolean, integer, string, string, string)
#1 .../includes/StubObject.php(129): StubObject->_call(string, array)
#2 .../extensions/PageForms/includes/PF_AutoeditAPI.php(914): StubObject->__call(string, array)
#3 .../extensions/PageForms/includes/PF_AutoeditAPI.php(112): PFAutoeditAPI->doAction()
#4 .../extensions/PageForms/specials/PF_FormEdit.php(93): PFAutoeditAPI->execute()
#5 .../extensions/PageForms/specials/PF_FormEdit.php(40): PFFormEdit->printForm(string, string, NULL)
#6 .../includes/specialpage/SpecialPage.php(522): PFFormEdit->execute(string)
#7 .../includes/specialpage/SpecialPageFactory.php(577): SpecialPage->run(string)
#8 .../includes/MediaWiki.php(282): SpecialPageFactory::executePath(Title, RequestContext)
#9 .../includes/MediaWiki.php(735): MediaWiki->performRequest()
#10 .../includes/MediaWiki.php(509): MediaWiki->main()
#11 .../index.php(43): MediaWiki->run()
#12 {main}

Event Timeline

Restricted Application added subscribers: Liuxinyu970226, Aklapper. · View Herald TranscriptSep 5 2019, 3:21 PM

Change 534720 had a related patch set uploaded (by markahershberger; owner: markahershberger):
[mediawiki/extensions/PageForms@master] Add tests to demonstrate errors

https://gerrit.wikimedia.org/r/534720

Change 534721 had a related patch set uploaded (by markahershberger; owner: markahershberger):
[mediawiki/extensions/PageForms@master] Added handling of missing template in for template

https://gerrit.wikimedia.org/r/534721

Change 534721 abandoned by markahershberger:
Added handling of missing template in for template

Reason:
breaking into other commits

https://gerrit.wikimedia.org/r/534721

Change 534720 abandoned by markahershberger:
Add tests to demonstrate errors

https://gerrit.wikimedia.org/r/534720