From 34ffba5b03739c1fd12dede0690620ff7d29fb56 Mon Sep 17 00:00:00 2001 From: "James D. Forrester" Date: Fri, 26 Jan 2024 13:23:23 -0500 Subject: [PATCH] Swap uses of Title::GAID_FOR_UPDATE for IDBAccessObject::READ_LATEST Deprecated in MediaWiki 1.34. Change-Id: I23732e29954d3410b22726a524c6e15b71b0d6a1 --- includes/DiscussionParser.php | 3 ++- includes/Model/Event.php | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/includes/DiscussionParser.php b/includes/DiscussionParser.php index fc2861383..702e4c09a 100644 --- a/includes/DiscussionParser.php +++ b/includes/DiscussionParser.php @@ -3,6 +3,7 @@ namespace MediaWiki\Extension\Notifications; use Article; +use IDBAccessObject; use Language; use MediaWiki\Extension\Notifications\Hooks\HookRunner; use MediaWiki\Extension\Notifications\Model\Event; @@ -55,7 +56,7 @@ abstract class DiscussionParser { $title = Title::newFromID( $revision->getPageId() ); // use the primary database for new page } else { - $title = Title::newFromID( $revision->getPageId(), Title::GAID_FOR_UPDATE ); + $title = Title::newFromID( $revision->getPageId(), IDBAccessObject::READ_LATEST ); } // not a valid title diff --git a/includes/Model/Event.php b/includes/Model/Event.php index 2fcd9471d..91c1c6ead 100644 --- a/includes/Model/Event.php +++ b/includes/Model/Event.php @@ -3,6 +3,7 @@ namespace MediaWiki\Extension\Notifications\Model; use Exception; +use IDBAccessObject; use InvalidArgumentException; use MediaWiki\Extension\Notifications\Bundleable; use MediaWiki\Extension\Notifications\Controller\NotificationController; @@ -294,7 +295,7 @@ class Event extends AbstractEntity implements Bundleable { $title = Title::newFromID( $targetPageId ); // Try primary database if there is no match if ( !$title ) { - $title = Title::newFromID( $targetPageId, Title::GAID_FOR_UPDATE ); + $title = Title::newFromID( $targetPageId, IDBAccessObject::READ_LATEST ); } if ( $title ) { $result[] = $title; @@ -564,7 +565,7 @@ class Event extends AbstractEntity implements Bundleable { $this->title = $title; return $this->title; } - $this->title = Title::newFromID( $this->pageId, $fromPrimary ? Title::GAID_FOR_UPDATE : 0 ); + $this->title = Title::newFromID( $this->pageId, $fromPrimary ? IDBAccessObject::READ_LATEST : 0 ); if ( $this->title ) { return $this->title; }