Page MenuHomePhabricator

{{bots}}/{{nobots}} fails if the templates are overridden with new page text
Closed, ResolvedPublicBUG REPORT

Description

As a rPWBC scripts/category_redirect.py user I noted that this script is, apparently not {{bots|deny=all}}/{{nobots}} compliant. So the only I could do to avoid the bot from editting a specific page was to fully protect it (see example).

Event Timeline

Xqt triaged this task as Medium priority.Sep 5 2020, 2:33 PM
Xqt changed the subtype of this task from "Task" to "Bug Report".

Change 639893 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [bugfix] Make category_redirect.py {{bots}}/{{nobots}} compliant

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

This is a bigger problem. Page.save checks for BotMayEdit but unfortuntely inside the already changed text:

<<<
@@ -1,2 +1 @@
+ {{Categoría redirigida|Wikilibros:Políticas y orientaciones}}
- #redirect [[:Categoría:Wikilibros:Políticas y orientaciones]]
- {{bots|deny=all}}

>>>

As you can see the the {{bot}} restriction was removed and is not taken into account then. The given patch solves the current problem but probably there should be a more general solution.

Xqt renamed this task from Make category_redirect.py {{bots}}/{{nobots}} compliant to {{bots}}/{{nobots}} fails if the templates are overridden with new page text.Nov 7 2020, 12:58 PM
Xqt raised the priority of this task from Medium to High.

Change 639893 merged by jenkins-bot:
[pywikibot/core@master] [bugfix] check for {{bots}}/{{nobots}} for original wiki text first

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