Page MenuHomePhabricator

Implement a method to create an ItemPage redirect
Closed, ResolvedPublic

Description

It's now possible to create ItemPage redirects. We should implement this functionality in Pywikibot too:

action=wbcreateredirect:

Parameters:

  • from: Entity ID to make a redirect
  • to: Entity ID to point the redirect to
  • token: A 'csrf' token retrieved from action=query&meta=tokens
  • bot: Mark this edit as bot (This URL flag will only be respected if the user belongs to the group "bot")

Example to turn Q11 into a redirect to Q12:

api.php?action=wbcreateredirect&from=Q11&to=Q12

This should be two parts: Part in site and part in page.

With T73979 a method to Page was added to create redirects, which doesn't directly use the site (only to save the page).

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:49 AM
bzimport set Reference to bz71980.
bzimport added a subscriber: Unknown Object (????).
XZise renamed this task from Implement ItemPage.makeRedirectPage(self, page) to Implement a method to create a ItemPage redirect.Feb 8 2015, 4:11 PM
XZise updated the task description. (Show Details)
XZise set Security to None.

Change 222220 had a related patch set uploaded (by John Vandenberg):
Implement create option for ItemPage's set_redirect_target()

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

jayvdb added subscribers: jayvdb, daniel, JeroenDeDauw.

So, we already have support for changing an existing item into a redirect.

However, is is possible to create a new item that is a redirect? i.e. is from optional?
https://test.wikidata.org/w/api.php?action=help&modules=wbcreateredirect
Looking at the code from T67584, it appears from is not optional.

Ladsgroup renamed this task from Implement a method to create a ItemPage redirect to Implement a method to create an ItemPage redirect.Jul 2 2015, 2:31 AM

I4bd8c7615f3306c0a1b1a13fea4a8cb940b3c564 clarifies this in Wikibase

I4bd8c7615f3306c0a1b1a13fea4a8cb940b3c564 clarifies this in Wikibase

So that is https://gerrit.wikimedia.org/r/#/c/222226/ . Good to clarify the current situation.

It would also be good to know if their is a reason why creating new items as a redirect shouldnt be allowed.

It would also be good to know if their is a reason why creating new items as a redirect shouldnt be allowed.

I can think of bots creating 'readable' redirects for 'important' items... Q6789054321

daniel claimed this task.

Item IDs are arbitrary identifiers. They are assigned sequentially, allowing items (or redirects) to be created with manually chosen IDs would lead to problems, technically, conceptually, and possibly socially.

Why should we allow extra (random) IDs to be assigned to an existing item? That's what explicitly creating redirects means. I see no sensible use case, and a lot of potential for abuse and mistakes.

The only use case I can see for redirects is allowing an ID to remain valid after merging two items into one. Am I missing something?

Change 222220 abandoned by John Vandenberg:
Implement create option for ItemPage's set_redirect_target()

Reason:
per daniel on T73980

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

jayvdb changed the task status from Declined to Resolved.Jul 2 2015, 11:04 AM

(Changing from Declined to Resolved as the original task was completed, and the 'create new item as a redirect' was added later to this task)

jayvdb removed a project: Patch-For-Review.

Yea, I am not sure it is sensible to create redirects. Thanks for clarifying there is no intention to support that.