Page MenuHomePhabricator

Remove support for $wgMaxRedirects
Closed, ResolvedPublic

Description

$wgMaxRedirects has never worked as intended (T32359), was never used by WMF (T67064), and cannot function properly with the current database schema. Since this feature is unused and of dubious value, it should be removed. Removing it will simplify ongoing refactoring work on the Content and WikiPage classes.

Problems with this feature as presently implemented:

  • Consider a redirect chain A -> B -> C
  • With $wgMaxRedirects = 2, the redirect table would record the "ultimate" targets, A -> C and B -> C.
  • When B is edited and now links to X, the redirect entry for A needs to be updated to be A -> X.
  • However, since there is no link A -> B recorded in the database, MediaWiki can't know that it needs to do anything about the redirect entry for A.

Other reasons why this feature cannot work as currently implemented:

  • Consider a redirect chain A -> B -> C
  • With $wgMaxRedirects = 2, a user accessing A will be shown page C, with the message "redirected from A".
  • If the user wants to change the redirect and goes to edit A, they find a redirect to B, not to C! They would have to known that they need to go to B to change the redirect.
  • It would be nice to show something like "redirected from A via B". But in order to do this, the link from A to B would have to be present in the database.

Consideration about changing the storage approach:

  • at the very least, only direct redirects should be recorded in the redirect table.
  • "deep" redirects could still be followed by following the individual steps in the redirect table, though that would be somewhat inefficient.
  • "deep" redirects could be recorded in a separate table, with the appropriate update logic in place to ensure consistency, if the cost for developing this is justified

In the light for the above, it seems best to simply remove support for now.

Event Timeline

As discussed with @daniel , ok from product side to remove this feature when time permits.

Ciencia_Al_Poder renamed this task from Remove support for $wgMaxRedirect to Remove support for $wgMaxRedirects.Apr 11 2022, 3:13 PM
Ciencia_Al_Poder updated the task description. (Show Details)

Change 779130 had a related patch set uploaded (by Daniel Kinzler; author: Daniel Kinzler):

[mediawiki/core@master] Remove support for $wgMaxRedirect

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

Change 779489 had a related patch set uploaded (by Gerrit maintenance bot; author: Gerrit maintenance bot):

[mediawiki/extensions/CirrusSearch@master] Replace getUltimateredirectTarget with getRedirectTarget. Since $wgMaxRedirect is being removed as dysfunctional, the ultimate redirect target is always the same as the immediate redirect target. because of that, getUltimateredirectTarget() has been deprecated in 1.38, and is emitting deprecation warnings now.

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

Change 779490 had a related patch set uploaded (by Gerrit maintenance bot; author: Gerrit maintenance bot):

[mediawiki/extensions/Collection@master] Replace getUltimateredirectTarget with getRedirectTarget. Since $wgMaxRedirect is being removed as dysfunctional, the ultimate redirect target is always the same as the immediate redirect target. because of that, getUltimateredirectTarget() has been deprecated in 1.38, and is emitting deprecation warnings now.

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

Change 779491 had a related patch set uploaded (by Gerrit maintenance bot; author: Gerrit maintenance bot):

[mediawiki/extensions/FlaggedRevs@master] Replace getUltimateredirectTarget with getRedirectTarget. Since $wgMaxRedirect is being removed as dysfunctional, the ultimate redirect target is always the same as the immediate redirect target. because of that, getUltimateredirectTarget() has been deprecated in 1.38, and is emitting deprecation warnings now.

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

Change 779489 merged by jenkins-bot:

[mediawiki/extensions/CirrusSearch@master] Replace getUltimateredirectTarget with getRedirectTarget.

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

Krinkle triaged this task as Medium priority.Apr 13 2022, 12:04 AM
Krinkle awarded a token.

Change 779930 had a related patch set uploaded (by Daniel Kinzler; author: Daniel Kinzler):

[mediawiki/extensions/Wikibase@master] Removing calls to Content::getRedirectChain()

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

Change 779929 had a related patch set uploaded (by Daniel Kinzler; author: Daniel Kinzler):

[mediawiki/extensions/ProofreadPage@master] Removing calls to Content::getRedirectChain()

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

Change 779491 merged by jenkins-bot:

[mediawiki/extensions/FlaggedRevs@master] Replace getUltimateredirectTarget with getRedirectTarget.

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

Change 779930 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Removing calls to Content::getRedirectChain()

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

Change 779929 merged by jenkins-bot:

[mediawiki/extensions/ProofreadPage@master] Removing calls to Content::getRedirectChain()

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

Change 779490 merged by jenkins-bot:

[mediawiki/extensions/Collection@master] Replace getUltimateredirectTarget with getRedirectTarget.

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

Change 789601 had a related patch set uploaded (by Daniel Kinzler; author: Daniel Kinzler):

[mediawiki/extensions/Forms@master] Do not use redirect chain.

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

Change 789602 had a related patch set uploaded (by Daniel Kinzler; author: Daniel Kinzler):

[mediawiki/extensions/Workflows@master] Do not use redirect chain.

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

Change 779130 merged by jenkins-bot:

[mediawiki/core@master] Remove support for $wgMaxRedirect

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

daniel claimed this task.

Change 802615 had a related patch set uploaded (by Robert Vogel; author: Daniel Kinzler):

[mediawiki/extensions/Workflows@REL1_35] Do not use redirect chain.

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

Change 802616 had a related patch set uploaded (by Robert Vogel; author: Daniel Kinzler):

[mediawiki/extensions/Workflows@REL1_35-1.0.x] Do not use redirect chain.

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

Change 789602 merged by Robert Vogel:

[mediawiki/extensions/Workflows@master] Do not use redirect chain.

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

Change 802616 merged by Robert Vogel:

[mediawiki/extensions/Workflows@REL1_35-1.0.x] Do not use redirect chain.

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

Change 802615 merged by jenkins-bot:

[mediawiki/extensions/Workflows@REL1_35] Do not use redirect chain.

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