Last modified: 2013-06-24 21:50:47 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 T35461, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 33461 - Bot flag logic is in EditPage.php, leaving all other ways of doing edits without it
Bot flag logic is in EditPage.php, leaving all other ways of doing edits with...
Status: NEW
Product: MediaWiki
Classification: Unclassified
Page editing (Other open bugs)
1.21.x
All All
: Normal normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 49071 (view as bug list)
Depends on:
Blocks: 18654 25455
  Show dependency treegraph
 
Reported: 2012-01-01 21:13 UTC by Thehelpfulone
Modified: 2013-06-24 21:50 UTC (History)
15 users (show)

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


Attachments

Description Thehelpfulone 2012-01-01 21:13:24 UTC
Hi,

On Meta-Wiki, I've been working on the Steward Elections and translations. I was editing https://meta.wikimedia.org/wiki/Stewards/Elections_2012/Guidelines/es through the Special:Translate intereface, and noticed that each translation was an edit, and so was creating quite a few changes on the RC feed.

On Meta, we have the "flood" flag which stops your contributions from showing up in the RC feed so as to not flood it, which I enabled as below:

(show/hide) 20:39, 1 January 2012 Thehelpfulone (talk | contribs | block) changed group membership for User:Thehelpfulone from administrator and translation administrator to administrator, translation administrator and flooder ‎ (going to be flooding)

However, the RC was still flooded as below:

(diff | hist) . . Stewards/Elections 2012/Guidelines/es‎; 20:45 . . (-5) . . Thehelpfulone (talk | contribs | block)‎ (Created page with "Cree una subpágina (sólo abra y guarde)")
(diff | hist) . . N Translations:Stewards/Elections 2012/Guidelines/75/es‎; 20:45 . . (+41) . . Thehelpfulone (talk | contribs | block)‎ (Created page with "Cree una subpágina (sólo abra y guarde)")
(diff | hist) . . Stewards/Elections 2012/Guidelines/es‎; 20:45 . . (+13) . . Thehelpfulone (talk | contribs | block)‎ (Created page with "Cree una página de discurso y otra de votación")
(diff | hist) . . N Translations:Stewards/Elections 2012/Guidelines/74/es‎; 20:45 . . (+48) . . Thehelpfulone (talk | contribs | block)‎ (Created page with "Cree una página de discurso y otra de votación")
(diff | hist) . . Stewards/Elections 2012/Guidelines/es‎; 20:44 . . (-6) . . Thehelpfulone (talk | contribs | block)‎ (Created page with "Si usted desea finalmente ser un candidato, siga las instrucciones")
(diff | hist) . . N Translations:Stewards/Elections 2012/Guidelines/72/es‎; 20:44 . . (+66) . . Thehelpfulone (talk | contribs | block)‎ (Created page with "Si usted desea finalmente ser un candidato, siga las instrucciones")
(diff | hist) . . Stewards/Elections 2012/Guidelines/es‎; 20:44 . . (0) . . Thehelpfulone (talk | contribs | block)‎ (Created page with "Solicitando")
(diff | hist) . . N Translations:Stewards/Elections 2012/Guidelines/71/es‎; 20:44 . . (+11) . . Thehelpfulone (talk | contribs | block)‎ (Created page with "Solicitando")
(diff | hist) . . Stewards/Elections 2012/Guidelines/es‎; 20:44 . . (-2) . . Thehelpfulone (talk | contribs | block)‎ (Created page with "Los stewards inactivos perderán sus permisos.")
(diff | hist) . . N Translations:Stewards/Elections 2012/Guidelines/70/es‎; 20:44 . . (+46) . . Thehelpfulone (talk | contribs | block)‎ (Created page with "Los stewards inactivos perderán sus permisos.")

Can you please ensure that the flood flag also applies to the Translate extension?

Thanks,

Thehelpfulone
Comment 1 John Du Hart 2012-01-01 21:16:54 UTC
Flooder group = bot right on meta wiki
Comment 2 Niklas Laxström 2012-01-02 10:07:08 UTC
As far as I can read my code it should just work. I'm copying all edit flags except EDIT_NEW and EDIT_UPDATE as is to the translation page edits.
Comment 3 Niklas Laxström 2012-01-02 10:15:28 UTC
I see it now. The bot flag is set manually by EditPage.php. I don't want add hacks like that into my code. Recategorizing to core bug.
Comment 4 Niklas Laxström 2012-01-02 10:16:56 UTC
In fact I can't even fix it, since allmost all translation edits go through the web API.
Comment 5 Nemo 2012-01-02 10:17:06 UTC
Example of what Niklas says: bot flag is not applied to translation unit edit either, and everything works when not using translation dialogs, e.g. right now

-      b! 11:11     Terms of use/it‎‎ (2 changes | hist) . . (-6) . .
[FuzzyBot‎; Nemo bis‎]
      b      11:11 (cur | prev) . . (0) . . Nemo bis (talk | contribs | block)
(Created page with "it") [rollback]
      b!     02:57 (cur | prev) . . (-6) . . FuzzyBot (talk | block) (Updating
to match new version of source page)
 N b  11:11     Translations:Terms of use/0-b/it‎ (diff | hist) . . (+2) . .
Nemo bis (talk | contribs | block) (Created page with "it")
Comment 6 Bawolff (Brian Wolff) 2012-01-02 10:22:01 UTC
(In reply to comment #4)
> In fact I can't even fix it, since allmost all translation edits go through the
> web API.

The web api supports the bot flag, but one has to explicitly specify it should be used, even if you have the bot flag. On the bright side, specifying bot will be quietly ignored if you don't have flag (So it could just always be specified), (but bot being quietly ignored without error isn't exactly documented, so probably shouldn't rely on it)
Comment 7 Siebrand Mazeland 2012-01-02 10:57:05 UTC
(In reply to comment #6)
> The web api supports the bot flag, but one has to explicitly specify it should
> be used, even if you have the bot flag. On the bright side, specifying bot will
> be quietly ignored if you don't have flag (So it could just always be
> specified), (but bot being quietly ignored without error isn't exactly
> documented, so probably shouldn't rely on it)

 This sound very illogical to me: an API edit is not made by a bot unless the client says so.

It should be: a client's edit is a bot edit if the editing user has a bit flag, unless that client specifically indicates its edit should NOT be marked as a bot edit. This should be consistent behaviour in all interfaces.
Comment 8 Siebrand Mazeland 2012-01-02 10:58:19 UTC
Bit flag = bot flag in comment 7 :/
Comment 9 Thehelpfulone 2012-01-12 18:55:34 UTC
Hmm, perhaps another thing to add to this - if I delete a page, that has, for example 50 subpages, is it possible to add a flag on to FuzzyBot so that it doesn't spam RC? I mean this hasn't been a problem yet, but it could be something to think about for the future.
Comment 10 Nemo 2012-01-12 19:00:48 UTC
(In reply to comment #9)
> Hmm, perhaps another thing to add to this - if I delete a page, that has, for
> example 50 subpages, is it possible to add a flag on to FuzzyBot so that it
> doesn't spam RC? I mean this hasn't been a problem yet, but it could be
> something to think about for the future.

This is another bug and it's already been fixed in trunk: the account will be created by the extension and so we'll be able to assign it to user groups.
Comment 11 Helder 2012-08-25 16:26:04 UTC
This is similar to LiquidThreads bug 25455.
Comment 12 Nemo 2013-02-03 22:38:48 UTC
*** Bug 41637 has been marked as a duplicate of this bug. ***
Comment 13 Nemo 2013-05-01 12:33:13 UTC
(In reply to comment #12)
> *** Bug 41637 has been marked as a duplicate of this bug. ***

Raising priority given repeated report by nl.wiki sysop. https://nl.wikipedia.org/w/index.php?title=Overleg_gebruiker%3ANemo_bis&diff=37505224&oldid=33957234
It would be nice if someone could look into it...
Comment 14 Andre Klapper 2013-05-02 12:37:22 UTC
(In reply to comment #13)
> (In reply to comment #12)
> Raising priority given repeated report by nl.wiki sysop.

One dup filed six months ago is not a good reason for sudden high priority.
Comment 15 James Alexander 2013-06-03 01:15:49 UTC
is there any update on where this is in the queue? There are multiple wikis who have complained and the bot is at risk of being blocked (and on two major wikis HAS been blocked) on these wikis because it isn't able to follow the local policies (which generally require a bot flag or a much slower edit rate and for it to respect a template denying access). Unfortunately with the bug the bot can even get the bot flag but still not be marked as such (The {{nobots}} question is separate).
Comment 16 Bawolff (Brian Wolff) 2013-06-03 01:32:15 UTC
(In reply to comment #15)
> is there any update on where this is in the queue? There are multiple wikis
> who
> have complained and the bot is at risk of being blocked (and on two major
> wikis
> HAS been blocked) on these wikis because it isn't able to follow the local
> policies (which generally require a bot flag or a much slower edit rate and
> for
> it to respect a template denying access). Unfortunately with the bug the bot
> can even get the bot flag but still not be marked as such (The {{nobots}}
> question is separate).

Its unclear which "bot" you are refering to, but if its just a normal bot, add the bot parameter to the api request....
Comment 17 James Alexander 2013-06-03 01:47:32 UTC
Sorry Bawolff I should have been more clear. 

It's the https://meta.wikimedia.org/wiki/User:Translation_Notification_Bot which I believe is actually a part of the TranslationNotifications extension. I actually had thought we should just be adding the api parameter too and I'm happy to open another bug but one about the same issue was marked as a duplicate of here (see comment 12 and 13) and it sounds like a couple people were told that the intention was to not make changes to the extension and to wait for this bug.
Comment 18 Bawolff (Brian Wolff) 2013-06-03 01:49:25 UTC
My apologies, I thought you meant some random normal bot.
Comment 19 MZMcBride 2013-06-03 01:57:47 UTC
The history of this bug is exceedingly silly. Yes, MediaWiki core is not perfect and EditPage.php could certainly use love, but there's no good reason that the bot flag shouldn't be set when making these edits. This should be a one-line fix.

Fortunately, bug 41637 has been re-opened, so I'll just go complain over there.
Comment 20 MZMcBride 2013-06-03 02:21:00 UTC
There are issues getting conflated here.

* bug 33461: abstraction issues in MediaWiki core's EditPage.php

* bug 41637: bot flag not being set in Extension:TranslationNotifications

* bug 49071: bot flag not being set in Extension:Translate

As I understand it.

In my opinion, every extension or other piece of code should using the MediaWiki API to make edits, so the abstraction issues in EditPage.php really shouldn't be relevant insofar as the bot flag is concerned.
Comment 21 Bawolff (Brian Wolff) 2013-06-03 02:42:15 UTC
(In reply to comment #20)
> There are issues getting conflated here.
> 
> * bug 33461: abstraction issues in MediaWiki core's EditPage.php
> 
> * bug 41637: bot flag not being set in Extension:TranslationNotifications
> 
> * bug 49071: bot flag not being set in Extension:Translate
> 
> As I understand it.
> 
> In my opinion, every extension or other piece of code should using the
> MediaWiki API to make edits, so the abstraction issues in EditPage.php really
> shouldn't be relevant insofar as the bot flag is concerned.

Most extensions do not use the api to do edits on the php side (they do use it if the edit is coming from js side). Calling the api internally from the php side is rather hacky curently (unless things have changed).
Comment 22 MZMcBride 2013-06-03 02:51:40 UTC
(In reply to comment #21)
> Most extensions do not use the api to do edits on the php side (they do use
> it if the edit is coming from js side). Calling the api internally from the php
> side is rather hacky curently (unless things have changed).

The MediaWiki API has sanity checks for user permissions, bot flags, blocks, etc. Duplicating this logic internally is senseless.
Comment 23 Niklas Laxström 2013-06-03 04:14:03 UTC
(In reply to comment #22)
> (In reply to comment #21)
> > Most extensions do not use the api to do edits on the php side (they do use
> > it if the edit is coming from js side). Calling the api internally from the php
> > side is rather hacky curently (unless things have changed).
> 
> The MediaWiki API has sanity checks for user permissions, bot flags, blocks,
> etc. Duplicating this logic internally is senseless.

Like said, calling the WebAPI internally is pita and hence nobody does it. There is even a bug open demanding that nobody does that in a certain way because it messes up things.
Comment 24 Matthew Flaschen 2013-06-03 05:05:06 UTC
(In reply to comment #20)
> There are issues getting conflated here.
> 
> * bug 33461: abstraction issues in MediaWiki core's EditPage.php
> 
> * bug 41637: bot flag not being set in Extension:TranslationNotifications
> 
> * bug 49071: bot flag not being set in Extension:Translate
> 
> As I understand it.

You're misunderstanding it.  The whole point of this bug is that there is code in EditPage that should be shared between the Edit API and EditPage ("In fact I can't even fix it, since allmost all translation edits go through the
web API.").  So your advice to use the WebAPI does not solve the problem.
Comment 25 MZMcBride 2013-06-03 06:24:14 UTC
(In reply to comment #24)
> You're misunderstanding it.  The whole point of this bug is that there is
> code in EditPage that should be shared between the Edit API and EditPage ("In
> fact I can't even fix it, since allmost all translation edits go through the
> web API.").  So your advice to use the WebAPI does not solve the problem.

Where is the specific code in the Translate extension that's making these edits? I tried to trace it via specials/SpecialTranslate.php.
Comment 26 Matthew Flaschen 2013-06-03 06:28:24 UTC
*** Bug 49071 has been marked as a duplicate of this bug. ***
Comment 27 Matthew Flaschen 2013-06-03 06:31:46 UTC
(In reply to comment #25)
> Where is the specific code in the Translate extension that's making these
> edits? I tried to trace it via specials/SpecialTranslate.php.

I think the relevant line is https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/Translate.git;a=blob;f=utils/TranslationEditPage.php;h=7b10e32150650b34dc22a40e206a86c83b3c4e14;hb=HEAD#l179 .

Please be cautious about cloning bugs/marking them easy/etc. if you're not sure you understand the issues.
Comment 28 MZMcBride 2013-06-03 06:33:19 UTC
(In reply to comment #27)
> Please be cautious about cloning bugs/marking them easy/etc. if you're not
> sure you understand the issues.

Why did you mark bug 49071 as a duplicate? This bug is about MediaWiki core. Bug 49071 is about the Translate extension specifically, which seems to be using the MediaWiki Web API and is not setting a bot parameter. What am I missing here?
Comment 29 Matthew Flaschen 2013-06-03 06:38:07 UTC
As Niklas said earlier:

"I see it now. The bot flag is set manually by EditPage.php. I don't want add
hacks like that into my code. Recategorizing to core bug."

He said the proper fix to this is in core, rather than a workaround in every extension.  Siebrand said:

"It should be: a client's edit is a bot edit if the editing user has a bit flag,
unless that client specifically indicates its edit should NOT be marked as a
bot edit."

I am inclined to agree with both of them.  This means changing the behavior of the bot parameter for https://www.mediawiki.org/wiki/API:Edit such that it overrides the account's flag (of course, regular users can not use the bot override), rather than making bot accounts always say "Remember, I'm a bot!" on every request.
Comment 30 MZMcBride 2013-06-03 06:52:23 UTC
I don't think it's appropriate to defer fixing a real issue (edits not being marked with the bot flag) in favor of potential future optimizations to EditPage.php, especially as the Translate extension, as far as I can tell, is using the MediaWiki Web API (either with JavaScript or with PHP that posts to /api.php), both of which already support fixing the underlying issue that was reported here with a trivial fix.
Comment 31 Matthew Flaschen 2013-06-03 07:02:09 UTC
(In reply to comment #30)
> I don't think it's appropriate to defer fixing a real issue (edits not being
> marked with the bot flag) in favor of potential future optimizations to
> EditPage.php, especially as the Translate extension, as far as I can tell, is
> using the MediaWiki Web API (either with JavaScript or with PHP that posts to
> /api.php), both of which already support fixing the underlying issue that was
> reported here with a trivial fix.

I'm not trying to prevent anyone from submitting a workaround to the Translate extension.

I'm simply saying I agree that core should be changed so such workarounds will no longer be necessary.

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


Navigation
Links