Lucas_Werkmeister_WMDE added a comment.

  I found a fix –
  
    diff --git a/src/hooks/CognatePageHookHandler.php 
b/src/hooks/CognatePageHookHandler.php
    index 01d2002..45b6392 100644
    --- a/src/hooks/CognatePageHookHandler.php
    +++ b/src/hooks/CognatePageHookHandler.php
    @@ -153,7 +153,8 @@ function () use ( $dbName, $linkTarget ) {
        public function onArticleUndelete(
                Title $title
        ) {
    -           $revision = $this->newRevisionRecordFromId( 
$title->getLatestRevID() );
    +           $revisionId = $title->getLatestRevID( Title::READ_LATEST );
    +           $revision = $this->newRevisionRecordFromId( $revisionId );
                if ( !$this->isActionableTarget( $title ) || $revision == null 
) {
                        return;
                }
  
  – but I’m still looking into why this is necessary. I feel like this 
shouldn’t be necessary on our hand, and that MediaWiki core should ensure the 
title has an up-to-date latest revision ID before calling our hook.

TASK DETAIL
  https://phabricator.wikimedia.org/T283654

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Lucas_Werkmeister_WMDE
Cc: toan, dang, Lucas_Werkmeister_WMDE, Aklapper, DannyS712, Invadibot, 
maantietaja, Akuckartz, Iflorez, alaa_wmde, Nandana, Lahi, Gq86, Pablo-WMDE, 
GoranSMilovanovic, QZanden, LawExplorer, _jensen, rosalieper, Scott_WUaS, 
Jonas, Thibaut120094, Wikidata-bugs, aude, Lydia_Pintscher, Darkdadaah, 
Jdforrester-WMF, Addshore, Mbch331, Ltrlg
_______________________________________________
Wikidata-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to