Last modified: 2014-11-09 21:06:41 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T61973, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 59973 - Pywikibot should have a wikibase-error-sitelink-already-used exception
Pywikibot should have a wikibase-error-sitelink-already-used exception
Status: NEW
Product: Pywikibot
Classification: Unclassified
Wikidata (Other open bugs)
All All
: High major
: ---
Assigned To: Pywikipedia bugs
Depends on:
Blocks: pwb20
  Show dependency treegraph
Reported: 2014-01-12 15:35 UTC by Maarten Dammers
Modified: 2014-11-09 21:06 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Maarten Dammers 2014-01-12 15:35:53 UTC
At the moment when you try to add a sitelink to an item at Wikidata that's already used, you'll get a 

Sitelink to Commons Category:Mormonism based on P373
Site link [// Category:Mormonism] is already used by item [[Q8808767]]. Perhaps the items should be [[Help:Merge|merged]] and one of them [[Wikidata:Deletion policy|deleted]]? Request deletion of one of the items at [[Wikidata:Requests for deletion]], or ask at [[Wikidata:Interwiki conflicts]] if you believe that they should not be merged.
{u'messages': {u'0': {u'type': u'error', u'name': u'wikibase-error-sitelink-already-used', u'parameters': [u'//', u'Category:Mormonism', u'Q8808767', u'commonswiki']}, u'html': {u'*': u'<p>Site link <a class="external text" href="//">Category:Mormonism</a> is already used by item <a href="/wiki/Q8808767" title="Q8808767">Q8808767</a>. Perhaps the items should be <a href="/wiki/Help:Merge" title="Help:Merge">merged</a> and one of them <a href="/wiki/Wikidata:Deletion_policy" title="Wikidata:Deletion policy">deleted</a>? Request deletion of one of the items at <a href="/wiki/Wikidata:Requests_for_deletion" title="Wikidata:Requests for deletion" class="mw-redirect">Wikidata:Requests for deletion</a>, or ask at <a href="/wiki/Wikidata:Interwiki_conflicts" title="Wikidata:Interwiki conflicts">Wikidata:Interwiki conflicts</a> if you believe that they should not be merged.\n</p>'}}}

This is a bit too low level for me. This should be caught by either site or page and a WikiBase exception should be thrown.

The behavior should probably be modeled after the IsRedirectPage exception. We might want to create some more Wikibase exceptions while we're at it, but I haven't looked into that.

Note You need to log in before you can comment on or make changes to this bug.