Page MenuHomePhabricator

Wiki does not see the last approved page as a current page
Closed, ResolvedPublic

Description

$article = new Article( $title, $revisionID );

Because of its use, the wiki always sees the page as oldid, even if it is aproven, and behaves accordingly. Some things don't work in Translate and add "noindex".

		if ( !empty( $revisionID ) || $egApprovedRevsBlankIfUnapproved ) {
			$article = new Article( $title, $revisionID );
			// This call is necessary because it
			// causes $article->mRevision to get initialized,
			// which in turn allows "edit section" links to show
			// up if the approved revision is also the latest.
			$article->fetchRevisionRecord();
		}

Changing this part to often solved problems for me:

		if ( !empty( $revisionID ) && $revisionID != $latestRevID ) {
			$article = new Article( $title, $revisionID );
			// This call is necessary because it
			// causes $article->mRevision to get initialized,
			// which in turn allows "edit section" links to show
			// up if the approved revision is also the latest.
			$article->fetchRevisionRecord();
		}

This problem also causes https://phabricator.wikimedia.org/T405007 problem.

Event Timeline

Change #1287729 had a related patch set uploaded (by Dumbledore; author: Dumbledore):

[mediawiki/extensions/ApprovedRevs@master] Fix bug where latest approved rev is treated as an old revision If the approved revision is also the latest revision, we shouldn't load it as a historical oldid. Doing so breaks extensions like Translate by hiding their UI elements and incorrectly applies a noindex tag to the current page.

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

Change #1287729 merged by jenkins-bot:

[mediawiki/extensions/ApprovedRevs@master] Prevent approved latest revisions from hiding Translate UI

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

Fixed, I think! Thank you, @Dumbledore .