Page MenuHomePhabricator

Depopulate categories when deleting them
Closed, DeclinedPublic

Description

Author: wishyashy

Description:
Right now, bots need to be involved when deleting a Category, which needs to be
emptied first. Renaming a cat is equally awkward. Is it possible to modify the
software so that you can choose to delete a Category from all linked pages with
the click of a button, or rename one easily? Thanks


Version: unspecified
Severity: enhancement

Details

Reference
bz9314

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 9:40 PM
bzimport set Reference to bz9314.
bzimport added a subscriber: Unknown Object (MLST).

robchur wrote:

Repurposing to cover just the deletion; renaming is bug 8685.

ayg wrote:

This can't be done cleanly as long as category membership is still stored in-band with the rest of the text, i.e., typing [[Category:Something]] to add to a category. See bug 167.

wishyashy wrote:

Sorry, I don't understand. Why can't you you delete all relevant textstrings ("[[[[Category:Foo]]") from the affected pages easily?

ayg wrote:

You have to account for <nowiki>, <pre>, <noinclude>, <includeonly>, <onlyinclude>, extensions, templates, and various weird combinations thereof. In particular, it can easily be impossible to algorithmically delete a template-generated category. Consider [[Template:A]] containing "Text [[Category:{{{1}}}]]", and [[B]] containing "{{A|Foo}}", then try to delete "[[Category:Foo]]" from that page without deleting "Text". (Of course, the latter would apply as long as templates can add categories, in-band or not.)

Yes, you could cobble something together for some cases, but as I said, it can't be done *cleanly*. At the very least you would have to partially parse every affected page to make sure you avoided basic constructs like <nowiki>, and that would take a long time. Not to mention it would be a huge pain to reverse.

DannyS712 subscribed.

Boldly declining per above. This could more easily done by a bot.