Page MenuHomePhabricator

pagegenerators should accept pageids
Closed, ResolvedPublic

Description

Originally from: http://sourceforge.net/p/pywikipediabot/feature-requests/231/
Reported by: mike_lifeguard
Created on: 2009-11-17 13:22:27
Subject: delete.py should accept pageids
Original description:
It is apparently possible to delete invalid titles using the API by specifying the pageid. delete.py should therefore accept pageids to delete, rather than titles. This should be possible with the -pageid:1234 parameter, or -file:/whatever -pageid if the file is a list of pageids rather than titles.


Version: core-(2.0)
Severity: enhancement
See Also:
https://sourceforge.net/p/pywikipediabot/feature-requests/231

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:18 AM
bzimport set Reference to bz55072.
bzimport added a subscriber: Unknown Object (????).

delete.py now uses the default pagegenerators (bug 55096)

Is it important to be able to delete 'invalid titles'. It sounds like it would be useful for stewards and SWMT?

I'm not convinced this would actually work -- Page.delete uses the title (as far as I know), not the page id...

Invalid titles are an issue for sites that have switched from latin-1 to utf-8 -- sometimes, they still have a latin-1 page title in the database, which then cannot be retrieved nor deleted.

I'm not convinced this would actually work -- Page.delete uses the title (as far as I know), not the page id...

Invalid titles are an issue for sites that have switched from latin-1 to utf-8 -- sometimes, they still have a latin-1 page title in the database, which then cannot be retrieved nor deleted.

It looks like you are right. Page.delete refers itself to Site, and Site.deletepage does explicitly use the page title.

However the API does support it.

https://en.wikipedia.org/w/api.php?action=paraminfo&modules=delete

So maybe we create a subtask to create a -pageid generator which works almost identically to -page

And once that is built, someone can enhance Page/Site methods to use pageid to delete if available (and supported by the site's API version?), and fallback to title if the pageid hasnt been loaded.

Change 285005 had a related patch set uploaded (by Mpaa):
site.py: delete page using pageid instead of title

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

Mpaa removed Mpaa as the assignee of this task.Oct 27 2020, 6:06 PM
Mpaa subscribed.

Change 285005 merged by jenkins-bot:
[pywikibot/core@master] site.py: delete page using pageid instead of title

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