Page MenuHomePhabricator

AFComputedVariable.php: Argument to getLinksFromDB() must be an instance of Article
Closed, ResolvedPublic

Description

Error

Request ID: W8ZbbgpAEMQAAICRtrgAAADR

message
PHP Fatal Error from line 230 of /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/AFComputedVariable.php:

Argument 1 passed to AFComputedVariable::getLinksFromDB() must be an instance of Article, WikiPage
trace
#0 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/AFComputedVariable.php(230): NO_FUNCTION_GIVEN()
#1 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/AbuseFilterVariableHolder.php(60): AFComputedVariable->compute(AbuseFilterVariableHolder)
#2 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/AFComputedVariable.php(253): AbuseFilterVariableHolder->getVar(string)
#3 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/AbuseFilterVariableHolder.php(60): AFComputedVariable->compute(AbuseFilterVariableHolder)
#4 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(847): AbuseFilterVariableHolder->getVar(string)
#5 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(746): AbuseFilterParser->getVarValue(string)
#6 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(728): AbuseFilterParser->doLevelAtom(AFPData)
#7 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(656): AbuseFilterParser->doLevelFunction(AFPData)
#8 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(612): AbuseFilterParser->doLevelBraces(AFPData)
#9 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(601): AbuseFilterParser->doLevelArrayElements(AFPData)
#10 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(562): AbuseFilterParser->doLevelUnarys(AFPData)
#11 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(552): AbuseFilterParser->doLevelSpecialWords(AFPData)
#12 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(524): AbuseFilterParser->doLevelBoolInvert(AFPData)
#13 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(503): AbuseFilterParser->doLevelPow(AFPData)
#14 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(477): AbuseFilterParser->doLevelMulRels(AFPData)
#15 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(455): AbuseFilterParser->doLevelSumRels(AFPData)
#16 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(443): AbuseFilterParser->doLevelCompares(AFPData)
#17 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(373): AbuseFilterParser->doLevelBoolOps(AFPData)
#18 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(294): AbuseFilterParser->doLevelConditions(AFPData)
#19 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(222): AbuseFilterParser->doLevelSet(AFPData)
#20 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(645): AbuseFilterParser->doLevelSemicolon(AFPData)
#21 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(612): AbuseFilterParser->doLevelBraces(AFPData)
#22 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(601): AbuseFilterParser->doLevelArrayElements(AFPData)
#23 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(562): AbuseFilterParser->doLevelUnarys(AFPData)
#24 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(552): AbuseFilterParser->doLevelSpecialWords(AFPData)
#25 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(524): AbuseFilterParser->doLevelBoolInvert(AFPData)
#26 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(503): AbuseFilterParser->doLevelPow(AFPData)
#27 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(477): AbuseFilterParser->doLevelMulRels(AFPData)
#28 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(455): AbuseFilterParser->doLevelSumRels(AFPData)
#29 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(443): AbuseFilterParser->doLevelCompares(AFPData)
#30 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(373): AbuseFilterParser->doLevelBoolOps(AFPData)
#31 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(294): AbuseFilterParser->doLevelConditions(AFPData)
#32 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(222): AbuseFilterParser->doLevelSet(AFPData)
#33 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(203): AbuseFilterParser->doLevelSemicolon(AFPData)
#34 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(189): AbuseFilterParser->doLevelEntry(AFPData)
#35 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(165): AbuseFilterParser->intEval(string)
#36 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/AbuseFilter.php(522): AbuseFilterParser->parse(string, integer)
#37 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/AbuseFilter.php(675): AbuseFilter::checkConditions(string, AbuseFilterVariableHolder, boolean)
#38 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/AbuseFilter.php(620): AbuseFilter::checkFilter(stdClass, AbuseFilterVariableHolder, Title, string, string)
#39 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/AbuseFilter.php(1145): AbuseFilter::checkAllFilters(AbuseFilterVariableHolder, string, Title, string)
#40 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/AbuseFilterHooks.php(123): AbuseFilter::filterAction(AbuseFilterVariableHolder, Title, string, User)
#41 /srv/mediawiki/php-1.32.0-wmf.26/extensions/AbuseFilter/includes/AbuseFilterHooks.php(58): AbuseFilterHooks::filterEdit(DerivativeContext, Wikibase\ItemContent, string, Status, string, boolean)
#42 /srv/mediawiki/php-1.32.0-wmf.26/includes/Hooks.php(174): AbuseFilterHooks::onEditFilterMergedContent(DerivativeContext, Wikibase\ItemContent, Status, string, User, boolean)
#43 /srv/mediawiki/php-1.32.0-wmf.26/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)
#44 /srv/mediawiki/php-1.32.0-wmf.26/extensions/Wikibase/repo/includes/Hooks/EditFilterHookRunner.php(110): Hooks::run(string, array)
#45 /srv/mediawiki/php-1.32.0-wmf.26/extensions/Wikibase/repo/includes/EditEntity.php(722): Wikibase\Repo\Hooks\EditFilterHookRunner->run(Wikibase\DataModel\Entity\Item, User, string)
#46 /srv/mediawiki/php-1.32.0-wmf.26/extensions/Wikibase/repo/includes/Api/EntitySavingHelper.php(351): Wikibase\EditEntity->attemptSave(Wikibase\DataModel\Entity\Item, string, integer, string)
#47 /srv/mediawiki/php-1.32.0-wmf.26/extensions/Wikibase/repo/includes/Api/ModifyEntity.php(310): Wikibase\Repo\Api\EntitySavingHelper->attemptSaveEntity(Wikibase\DataModel\Entity\Item, string)
#48 /srv/mediawiki/php-1.32.0-wmf.26/includes/api/ApiMain.php(1570): Wikibase\Repo\Api\ModifyEntity->execute()
#49 /srv/mediawiki/php-1.32.0-wmf.26/includes/api/ApiMain.php(531): ApiMain->executeAction()
#50 /srv/mediawiki/php-1.32.0-wmf.26/includes/api/ApiMain.php(502): ApiMain->executeActionWithErrorHandling()
#51 /srv/mediawiki/php-1.32.0-wmf.26/api.php(87): ApiMain->execute()

Impact

Fatal error, aborting the user action in question (in this case, an edit).

Notes

Started immediate after 1.32.0-wmf.26 went live on test.wikidata.org.

Event Timeline

Krinkle triaged this task as Unbreak Now! priority.Oct 16 2018, 9:48 PM
Krinkle created this task.

I'm sorry but I cannot send a patch right no. However, this can be simply fixed by removing the recently added typehinting.

Change 467853 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/AbuseFilter@master] Revert "Add typehinting for every object-only parameter"

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

Change 467861 had a related patch set uploaded (by Krinkle; owner: Jforrester):
[mediawiki/extensions/AbuseFilter@wmf/1.32.0-wmf.26] Revert "Add typehinting for every object-only parameter"

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

I'm sorry but I cannot send a patch right no. However, this can be simply fixed by removing the recently added typehinting.

Thanks for the quick reply!

As for the original patch, it's a good direction for the code to move in, so I hope this won't discourage you. Do feel free to CC me again on Gerrit when you have time to resubmit and investigate :)

Change 467853 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Revert "Add typehinting for every object-only parameter"

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

Change 467865 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/AbuseFilter@REL1_32] Revert "Add typehinting for every object-only parameter"

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

Change 467865 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@REL1_32] Revert "Add typehinting for every object-only parameter"

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

@Krinkle thanks, I uploaded it again and fixed the wrong typehint. I also left a ToDo, which can be handled either in that same patch, or in a separate one.

Change 467861 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@wmf/1.32.0-wmf.26] Revert "Add typehinting for every object-only parameter"

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

@Krinkle I amended the original patch; the only change is for articleFromTitle, renamed to pageFromTitle and made it only work with WikiPage.

Mentioned in SAL (#wikimedia-operations) [2018-10-17T15:53:44Z] <twentyafterfour@deploy1001> Synchronized php-1.32.0-wmf.26/extensions/AbuseFilter/: sync AbuseFilter revision rEABF4e2a6b665825 to 1.32.0-wmf.26 refs T207220 (duration: 00m 58s)

Krinkle closed this task as Resolved.Oct 17 2018, 6:33 PM
Krinkle claimed this task.
mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:07 PM