- This is a minor error in T326056: Show a warning on creating double redirect
- It is similar to T395767: BrokenRedirectConstraint allows changing broken redirect target to another non-existent page without error
Steps to replicate the issue
- Try to create a redirect to another redirect. E.g. on English Wikipedia, [[USA]], which redirects to [[United States]].
- An error is thrown (expected behaviour), which suggests the target be changed (e.g. to [[United States]])
- Ignore these instructions, and instead redirect to a different redirect page (e.g. to [[United States of America]]), or some other redirect with a different target, e.g. [[Republic of France]].
What happens?
What I think will happen here is that it will allow the creation of a double redirect because the self-constraint is passed.
What should have happened here instead?
Another warning should have been thrown about this edit attempt.
Notes
The key condition in checkConstraint() is:
if ( !$currentTarget || !$currentTarget->isRedirect() ) { // fail constraint }