Page MenuHomePhabricator

Catchable fatal error: Argument 1 passed to ProofreadPage::onArticlePurge() must be an instance of Article, WikiPage given in /srv/mediawiki/php-1.28.0-wmf.16/extensions/ProofreadPage/ProofreadPage.body.php on line 444
Closed, ResolvedPublic

Description

New from 1.28.0-wmf.16 ?

Catchable fatal error: Argument 1 passed to ProofreadPage::onArticlePurge() must be an instance of Article, WikiPage given in /srv/mediawiki/php-1.28.0-wmf.16/extensions/ProofreadPage/ProofreadPage.body.php on line 444

+

fatal error: Argument 1 passed to ProofreadPage::updatePrIndex() must be an instance of Article, WikiPage given
in /srv/mediawiki/php-1.28.0-wmf.16/ex
tensions/ProofreadPage/ProofreadPage.body.php on line 491

Event Timeline

hashar created this task.Aug 24 2016, 7:08 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 24 2016, 7:08 PM

Most probably caused by rEPRP3dd2896a6937: Improve ProofreadPage method signatures

        /**
         * When an index page is created or purged, recompute pr_index values
-        * @param $article Article
+        * @param Article $article
         * @return bool
         */
-       public static function onArticlePurge( $article ) {
+       public static function onArticlePurge( Article $article ) {
                $title = $article->getTitle();

But from MediaWiki core the hook pass a WikiPage, not an Article. Both implement Page though:

docs/hooks.txt
'ArticlePurge': Before executing "&action=purge".
&$wikiPage: WikiPage (object) to purge

Probably want to review all the signatures and make sure they are consistent with objects passed by the hook.

hashar added a subscriber: Tpt.Aug 24 2016, 7:26 PM
Dereckson updated the task description. (Show Details)Aug 24 2016, 7:41 PM

If there is another hook being hit maybe we can revert the patch introducing the type hints and revisit later?

Change 306497 had a related patch set uploaded (by Dereckson):
Fix hooks signatures

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

Change 306498 had a related patch set uploaded (by Hashar):
Fix hooks signatures

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

Change 306498 merged by jenkins-bot:
Fix hooks signatures

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

Mentioned in SAL [2016-08-24T20:02:15Z] <hashar@tin> Synchronized php-1.28.0-wmf.16/extensions/ProofreadPage/ProofreadPage.body.php: Fix hooks signatures T143817 (duration: 00m 47s)

Should be good now :)

hashar closed this task as Resolved.Aug 24 2016, 8:15 PM
Dereckson reopened this task as Open.Aug 24 2016, 10:09 PM
Dereckson added a subscriber: Yann.

Tested with @Yann , there is another patch to merge to resume normal behavior.

Currently, we can't delete pages in Page: namespace.

Mentioned in SAL [2016-08-24T23:33:11Z] <dereckson@tin> Synchronized php-1.28.0-wmf.16/extensions/ProofreadPage/ProofreadPage.body.php: Fix ProofreadPage::updatePrIndex signature (T143817) (duration: 00m 50s)

Dereckson closed this task as Resolved.Aug 24 2016, 11:52 PM

Tested with @Yann, deletion works again.

Well done @Dereckson and thank you @Yann