Page MenuHomePhabricator

[Bug] HTMLFormField calls Message::setContext( null )
Closed, ResolvedPublic

Description

Steps to reproduce:

Response headers I get:

Accept-Ranges: bytes
Age: 0
Backend-Timing: D=355897 t=1462352770925853
Cache-Control: no-cache
Content-Encoding: gzip
Content-Length: 20
Content-Type: text/html
Date: Wed, 04 May 2016 09:06:11 GMT
Server: mw1200.eqiad.wmnet
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
Vary: Accept-Encoding
Via: 1.1 varnish, 1.1 varnish, 1.1 varnish
X-Cache: cp1068 pass+chfp(0), cp3041 pass+chfp(0), cp3042 frontend pass+chfp(0)
X-Firefox-Spdy: 3.1
X-Powered-By: HHVM/3.12.1
x-analytics: WMF-Last-Access=04-May-2016;https=1
x-client-ip: 87.138.110.76
x-content-type-options: nosniff
x-varnish: 198182218, 2132090503, 1656587994

But the response itself is missing. The option is not saved. You can check that with https://test.wikidata.org/w/api.php?action=query&format=jsonfm&meta=userinfo&uiprop=options.

Other usages of the same API work:

  • Try to use an invalid token. You get the correct error message.
  • Try an invalid option name. You get the correct error message.
  • Try an other option, e.g. set searchNs0 to true or false. This works just fine.

Update: Got a stack trace.

{"file":"/srv/mediawiki/php-1.27.0-wmf.23/includes/htmlform/HTMLFormField.php","line":1098,"function":"setContext","class":"Message","type":"->","args":["NULL"]},
{"file":"/srv/mediawiki/php-1.27.0-wmf.23/includes/htmlform/HTMLFormField.php","line":384,"function":"getMessage","class":"HTMLFormField","type":"->","args":["string"]},
{"file":"/srv/mediawiki/php-1.27.0-wmf.23/includes/htmlform/HTMLForm.php","line":462,"function":"__construct","class":"HTMLFormField","type":"->","args":["array"]},
{"file":"/srv/mediawiki/php-1.27.0-wmf.23/includes/api/ApiOptions.php","line":89,"function":"loadInputFromParameters","class":"HTMLForm","type":"::","args":["string","array"]},
{"file":"/srv/mediawiki/php-1.27.0-wmf.23/includes/api/ApiMain.php","line":1367,"function":"execute","class":"ApiOptions","type":"->","args":[]},
{"file":"/srv/mediawiki/php-1.27.0-wmf.23/includes/api/ApiMain.php","line":468,"function":"executeAction","class":"ApiMain","type":"->","args":[]},
{"file":"/srv/mediawiki/php-1.27.0-wmf.23/includes/api/ApiMain.php","line":434,"function":"executeActionWithErrorHandling","class":"ApiMain","type":"->","args":[]},
{"file":"/srv/mediawiki/php-1.27.0-wmf.23/api.php","line":83,"function":"execute","class":"ApiMain","type":"->","args":[]}, {"file":"/srv/mediawiki/w/api.php","line":3,"function":"include","args":["string"]}

Details

Related Gerrit Patches:

Event Timeline

Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptMay 4 2016, 9:16 AM

Change 286805 had a related patch set uploaded (by Thiemo Mättig (WMDE)):
Expand term box by default even if option does not exist

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

I tried this twice and got the following fatal:

May  4 12:13:56 mw1017:  #012Catchable fatal error: Argument 1 passed to Message::setContext() must implement interface IContextSource, null given in /srv/mediawiki/php-1.27.0-wmf.23/includes/Message.php on line 676

There's no backtrace available, see T89169 for that.

Change 286805 merged by jenkins-bot:
Expand term box by default even if option does not exist

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

JanZerebecki updated the task description. (Show Details)May 4 2016, 1:11 PM
thiemowmde triaged this task as Unbreak Now! priority.May 4 2016, 1:20 PM
thiemowmde removed a project: Patch-For-Review.
thiemowmde added subscribers: Anomie, Tgr.
Restricted Application added subscribers: Luke081515, TerraCodes, Urbanecm. · View Herald TranscriptMay 4 2016, 1:20 PM

Issue introduced in https://gerrit.wikimedia.org/r/283846, mostly because the local property is not properly documented as HTMLForm|null. Please either revert the patch or provide a fix.

thiemowmde renamed this task from [Bug] HHVM on test.wikidata.org dies with no output when setting an option to [Bug] HTMLFormField calls Message::setContext( null ).May 4 2016, 1:26 PM
thiemowmde updated the task description. (Show Details)

Change 286840 had a related patch set uploaded (by Thiemo Mättig (WMDE)):
Fix HTMLFormField calling Message::setContext with null

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

Tgr added a comment.May 4 2016, 2:30 PM

Thanks for fixing!

Do you know when it makes sense to have a form field without a form? It would be good to add that to the documentation.

Change 286840 merged by jenkins-bot:
Fix HTMLFormField calling Message::setContext with null

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

Change 286855 had a related patch set uploaded (by Thiemo Mättig (WMDE)):
Fix HTMLFormField calling Message::setContext with null

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

Change 286864 had a related patch set uploaded (by Gergő Tisza):
ApiOptions: set form field parent earlier

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

Change 286855 merged by jenkins-bot:
Fix HTMLFormField calling Message::setContext with null

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

thiemowmde assigned this task to Tgr.May 4 2016, 3:42 PM
thiemowmde lowered the priority of this task from Unbreak Now! to Medium.
thiemowmde moved this task from Proposed to Done on the Wikidata-Sprint-2016-04-26 board.

Change 286864 merged by jenkins-bot:
ApiOptions: set form field parent earlier

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

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:11 PM