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, ResolvedPublicPRODUCTION ERROR

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

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.

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)

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)

Tested with @Yann, deletion works again.

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