If an Item exists and also has deleted revisions, we currently fail to redirect it, claiming "Could not create a new page. It already exists.".
Description
Details
Event Timeline
Change 350087 had a related patch set uploaded (by Hoo man):
[mediawiki/extensions/Wikibase@master] Use Title::exists to find out whether a page exists
Can you please explain this tasks description in more detail? It says one can not create a redirect "if an Item has deleted revisions". If this sentence is true it means no redirect can be created, because all redirects are meant to replace deleted Items.
But what the patch https://gerrit.wikimedia.org/r/350087 does is the opposite. The old code did not allowed to create a redirect if there are no deleted revisions. So: o_O?
What I meant is that: You can't turn an Item into a redirect if it has one or more deleted revisions.
If this is the problem, how does it help to remove an other check that is there to block creating redirects if there was no deleted revision? How can such a check do the opposite?
You latest comment on the patch helps. I still wonder.
The semantics of Title::isDeleted seem to be utterly broken. It does not say if a page is currently deleted, but if there was ever a revision deleted, and how much. Can we please deprecate this shit and rename it to hasDeletedRevisons or something?
Yes, that's the root of the problem here: Title::isDeleted is true (well an integer over 0) if there are deleted revisions for a page, no matter whether the page currently exists (which is very counter intuitive). Thus setting EDIT_NEW (which says we that only page creation is allowed) based on Title::isDeleted can lead to the problems described here.
Change 351334 had a related patch set uploaded (by Thiemo Mättig (WMDE); owner: Thiemo Mättig (WMDE)):
[mediawiki/extensions/Wikibase@master] Avoid duplicate and optional code in CreateRedirectTest
Change 350087 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Redirect creation: Don't set EDIT_NEW on edit if the page exists
Change 351334 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Avoid duplicate and optional code in CreateRedirectTest