Page MenuHomePhabricator

TwoColConflictHooks: setDisabled() on a non-object (null) / Undefined index: preview
Closed, ResolvedPublic3 Story Points

Description

Error

Request ID: XUxQ1wpAMFAAAK8-QVwAAACT
Request URL: https://zh.wikipedia.org/w/index.php?title=%E6%A8%A1%E5%9D%97:%E6%B2%99%E7%9B%92/TimWu007&action=submit

message
XUxQ1wpAMFAAAK8-QVwAAACT] /w/index.php?title=%E6%A8%A1%E5%9D%97:%E6%B2%99%E7%9B%92/TimWu007&action=submit   BadMethodCallException from line 145 of /srv/mediawiki/php-1.34.0-wmf.16/extensions/TwoColConflict/includes/TwoColConflictHooks.php: Call to a member function setDisabled() on a non-object (null)
trace
#0 /srv/mediawiki/php-1.34.0-wmf.16/includes/Hooks.php(174): TwoColConflict\TwoColConflictHooks::onEditPageBeforeEditButtons(EditPage, array, integer)
#1 /srv/mediawiki/php-1.34.0-wmf.16/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)
#2 /srv/mediawiki/php-1.34.0-wmf.16/includes/EditPage.php(4331): Hooks::run(string, array)
#3 /srv/mediawiki/php-1.34.0-wmf.16/includes/EditPage.php(3739): EditPage->getEditButtons(integer)
#4 /srv/mediawiki/php-1.34.0-wmf.16/includes/EditPage.php(2986): EditPage->showStandardInputs()
#5 /srv/mediawiki/php-1.34.0-wmf.16/includes/EditPage.php(707): EditPage->showEditForm()
#6 /srv/mediawiki/php-1.34.0-wmf.16/includes/actions/EditAction.php(55): EditPage->edit()
#7 /srv/mediawiki/php-1.34.0-wmf.16/includes/actions/SubmitAction.php(38): EditAction->show()
#8 /srv/mediawiki/php-1.34.0-wmf.16/includes/MediaWiki.php(507): SubmitAction->show()
#9 /srv/mediawiki/php-1.34.0-wmf.16/includes/MediaWiki.php(302): MediaWiki->performAction(Article, Title)
#10 /srv/mediawiki/php-1.34.0-wmf.16/includes/MediaWiki.php(892): MediaWiki->performRequest()
#11 /srv/mediawiki/php-1.34.0-wmf.16/includes/MediaWiki.php(523): MediaWiki->main()
#12 /srv/mediawiki/php-1.34.0-wmf.16/index.php(42): MediaWiki->run()
#13 /srv/mediawiki/w/index.php(3): include(string)
#14 {main}

I expect this is causally related (in one direction or the other) to:

message
[XUxQ1wpAMFAAAK8-QVwAAACT] /w/index.php?title=%E6%A8%A1%E5%9D%97:%E6%B2%99%E7%9B%92/TimWu007&action=submit   ErrorException from line 145 of /srv/mediawiki/php-1.34.0-wmf.16/extensions/TwoColConflict/includes/TwoColConflictHooks.php: PHP Notice: Undefined index: preview
trace
#0 /srv/mediawiki/php-1.34.0-wmf.16/extensions/TwoColConflict/includes/TwoColConflictHooks.php(145): MWExceptionHandler::handleError(integer, string, string, integer, array, array)
#1 /srv/mediawiki/php-1.34.0-wmf.16/includes/Hooks.php(174): TwoColConflict\TwoColConflictHooks::onEditPageBeforeEditButtons(EditPage, array, integer)
#2 /srv/mediawiki/php-1.34.0-wmf.16/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)
#3 /srv/mediawiki/php-1.34.0-wmf.16/includes/EditPage.php(4331): Hooks::run(string, array)
#4 /srv/mediawiki/php-1.34.0-wmf.16/includes/EditPage.php(3739): EditPage->getEditButtons(integer)
#5 /srv/mediawiki/php-1.34.0-wmf.16/includes/EditPage.php(2986): EditPage->showStandardInputs()
#6 /srv/mediawiki/php-1.34.0-wmf.16/includes/EditPage.php(707): EditPage->showEditForm()
#7 /srv/mediawiki/php-1.34.0-wmf.16/includes/actions/EditAction.php(55): EditPage->edit()
#8 /srv/mediawiki/php-1.34.0-wmf.16/includes/actions/SubmitAction.php(38): EditAction->show()
#9 /srv/mediawiki/php-1.34.0-wmf.16/includes/MediaWiki.php(507): SubmitAction->show()
#10 /srv/mediawiki/php-1.34.0-wmf.16/includes/MediaWiki.php(302): MediaWiki->performAction(Article, Title)
#11 /srv/mediawiki/php-1.34.0-wmf.16/includes/MediaWiki.php(892): MediaWiki->performRequest()
#12 /srv/mediawiki/php-1.34.0-wmf.16/includes/MediaWiki.php(523): MediaWiki->main()
#13 /srv/mediawiki/php-1.34.0-wmf.16/index.php(42): MediaWiki->run()
#14 /srv/mediawiki/w/index.php(3): include(string)
#15 {main}
Notes

Showing up in logs at a low level going back to at least wmf.11.

Event Timeline

brennen created this task.Aug 8 2019, 6:33 PM
Restricted Application added a project: TCB-Team. · View Herald TranscriptAug 8 2019, 6:33 PM
Restricted Application added subscribers: Cosine02, Aklapper. · View Herald Transcript
Krinkle triaged this task as High priority.Aug 16 2019, 11:13 AM

So looking into the pages affected it seems, this was always happening on pages in the Module namespace, what makes sense since we do not have a preview button when editing modules there. - I'll add a patch that checks if the button exists before we try to disable it.

Change 530609 had a related patch set uploaded (by WMDE-Fisch; owner: WMDE-Fisch):
[mediawiki/extensions/TwoColConflict@master] Check if preview button exists before disabling it

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

WMDE-Fisch set the point value for this task to 3.
WMDE-Fisch moved this task from Sprint Backlog to Review on the WMDE-QWERTY-Sprint-2019-08-08 board.

Change 530609 merged by jenkins-bot:
[mediawiki/extensions/TwoColConflict@master] Check if preview button exists before disabling it

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

So looking into the pages affected it seems, this was always happening on pages in the Module namespace, what makes sense since we do not have a preview button when editing modules there. - I'll add a patch that checks if the button exists before we try to disable it.

I was just thinking about this the other day. It would be amazing if we could preview templates and modules, maybe TemplateData could include an "examples" key which contains sample invocations? This is a future project of course, not coupled to the task here.

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:06 PM
thiemowmde closed this task as Resolved.Wed, Oct 9, 2:01 PM
thiemowmde claimed this task.