Page MenuHomePhabricator

Do not generate RecentChanges entries for redirects from page moves
Closed, ResolvedPublic

Description

Two issues now occur for redirects from moves (following Change 708357):

  • An unnecessary RC entry is created for the redirect from a move, and
  • That RC entry is not autopatrolled even if the move was done by an autopatrolled user (although page curation says that the page was autopatrolled)

To fix this, EDIT_SUPPRESS_RC should be used for redirects from moves.

Event Timeline

Change 723346 had a related patch set uploaded (by GeoffreyT2000; author: GeoffreyT2000):

[mediawiki/core@master] Revert \"MovePage - use PageUpdater to create redirect page\"

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

Change 723342 had a related patch set uploaded (by Ppchelko; author: Ppchelko):

[mediawiki/core@master] MovePage: don't create a recent change for a redirect

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

Change 723346 abandoned by GeoffreyT2000:

[mediawiki/core@master] Revert \"MovePage - use PageUpdater to create redirect page\"

Reason:

Other user suggested a different solution to the problem.

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

GeoffreyT2000 renamed this task from Revert use of PageUpdater for redirects from page moves to Do not generate RecentChanges entries for redirects from page moves.Sep 24 2021, 3:19 AM
GeoffreyT2000 updated the task description. (Show Details)
GeoffreyT2000 added a subscriber: Pchelolo.
GeoffreyT2000 renamed this task from Do not generate RecentChanges entries for redirects from page moves to Do not generate RecentChanges or page creation log entries for redirects from page moves.Sep 24 2021, 2:57 PM
GeoffreyT2000 updated the task description. (Show Details)

After T291689 is resolved, one could then instead do the following:

  • Replace lines 1029 through 1034 in the "includes/MovePage.php" file with the following code:
$redirectArticle->doUserEditContent(
	$redirectContent,
	$user,
	$commentObj,
	EDIT_NEW | EDIT_SUPPRESS_RC | EDIT_SUPPRESS_CREATE_LOG,
	false,
	$changeTags);
  • Revert the changes made to the "includes/Storage/PageUpdater.php" file in Change 708357.

Hopefully, using doUserEditContent (yes, that does call PageUpdater) will automatically tag the resulting redirect creation with the "mw-new-redirect" tag. More changes might be needed to ensure that the same tag is not also applied to the move log entry.

PageUpdater is a replacement for deprecated WikiPage::doUserEditContent method. That method is intended to be removed.

EDIT_SUPPRESS_CREATE_LOG is not strictly needed since PageUpdater has setUsePageCreationLog which is used in MovePage. However I personally like the flag more, so we can switch.

I'm not sure I understand the problem with tags - we do already set mw-new-redirect tag on PageUpdater in MovePage, is it not appearing for you?

Legoktm added a subscriber: Legoktm.

Another possible regression from this change was reported in T291677: Do not generate RecentChanges entries for redirects from page moves:

Yesterday I updated my version of pywikibot, and since the update my moves shown at the recent changes. I think that before the update it was fine, but not sure...

Given that API action=move doesn't expose a bot= parameter, it seems more likely to be a MediaWiki regression.

Legoktm triaged this task as High priority.Sep 24 2021, 4:44 PM
Legoktm added a project: Regression.

Change 723342 merged by jenkins-bot:

[mediawiki/core@master] MovePage: don't create a recent change for a redirect

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

Change 723582 had a related patch set uploaded (by Legoktm; author: Ppchelko):

[mediawiki/core@wmf/1.38.0-wmf.1] MovePage: don't create a recent change for a redirect

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

Change 723582 merged by jenkins-bot:

[mediawiki/core@wmf/1.38.0-wmf.1] MovePage: don't create a recent change for a redirect

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

Mentioned in SAL (#wikimedia-operations) [2021-09-24T18:57:30Z] <legoktm@deploy1002> Synchronized php-1.38.0-wmf.1/includes/MovePage.php: MovePage: don't create a recent change for a redirect (T291677) (duration: 00m 57s)

Backported, but it's unclear to me if this is fully fixed or if it still needs T291689: Add a new flag named "EDIT_SUPPRESS_CREATE_LOG", @GeoffreyT2000 could you clarify?

GeoffreyT2000 renamed this task from Do not generate RecentChanges or page creation log entries for redirects from page moves to Do not generate RecentChanges entries for redirects from page moves.Fri, Sep 24, 9:12 PM
GeoffreyT2000 updated the task description. (Show Details)

Closing as resolved then.