Change 'fromdbmaster' to WikiPage::READ_LATEST

Constants are harder to misspell

Change-Id: Ie1afcc8580cccf815df1cc97f05a5be81676d9f7
This commit is contained in:
Umherirrender 2021-09-26 20:52:30 +02:00
parent adee073758
commit 0e4bb6d611
6 changed files with 6 additions and 6 deletions

View file

@ -2052,7 +2052,7 @@ class EditPage implements IEditObject {
# Load the page data from the primary DB. If anything changes in the meantime,
# we detect it by using page_latest like a token in a 1 try compare-and-swap.
$this->page->loadPageData( 'fromdbmaster' );
$this->page->loadPageData( WikiPage::READ_LATEST );
$new = !$this->page->exists();
$flags = EDIT_AUTOSUMMARY |

View file

@ -87,7 +87,7 @@ class ImportableOldRevisionImporter implements OldRevisionImporter {
Title::clearCaches();
$page = $this->wikiPageFactory->newFromTitle( $importableRevision->getTitle() );
$page->loadPageData( 'fromdbmaster' );
$page->loadPageData( WikiPage::READ_LATEST );
if ( !$page->exists() ) {
// must create the page...
$pageId = $page->insertOn( $dbw );

View file

@ -553,7 +553,7 @@ class WikiImporter {
if ( !$this->disableStatisticsUpdate ) {
$page = $this->wikiPageFactory->newFromTitle( $pageIdentity );
$page->loadPageData( 'fromdbmaster' );
$page->loadPageData( WikiPage::READ_LATEST );
$content = $page->getContent();
if ( $content === null ) {
wfDebug( __METHOD__ . ': Skipping article count adjustment for ' . $pageIdentity .

View file

@ -647,7 +647,7 @@ class NamespaceDupes extends Maintenance {
$sourceTitle = Title::makeTitle( $row->page_namespace, $row->page_title );
$sourceTitle->resetArticleID( $id );
$wikiPage = new WikiPage( $sourceTitle );
$wikiPage->loadPageData( 'fromdbmaster' );
$wikiPage->loadPageData( WikiPage::READ_LATEST );
$destId = $newTitle->getArticleID();
$this->beginTransaction( $dbw, __METHOD__ );

View file

@ -1795,7 +1795,7 @@ class ParserTestRunner {
$newContent = ContentHandler::makeContent( $text, $title );
$page = WikiPage::factory( $title );
$page->loadPageData( 'fromdbmaster' );
$page->loadPageData( WikiPage::READ_LATEST );
if ( $page->exists() ) {
$content = $page->getContent( RevisionRecord::RAW );

View file

@ -1638,7 +1638,7 @@ more stuff
* @param callable $assertions
*/
public function testNewFromRow( $row, $assertions ) {
$page = WikiPage::newFromRow( $row, 'fromdb' );
$page = WikiPage::newFromRow( $row, WikiPage::READ_NORMAL );
$assertions( $page, $this );
}