The edit to the description page made during file upload is not tagged by OAuth

bzimport added a subscriber: Unknown Object (MLST).
bzimport set Reference to bz62908.
Bawolff created this task.Via LegacyMar 21 2014, 1:58 AM
Anomie added a comment.Via ConduitMar 21 2014, 2:16 PM

(In reply to Bawolff (Brian Wolff) from comment #0)

Perhaps something to do with the dummy edit being hidden from RC (?)

That is very likely the case: OAuth uses the RecentChange_save hook to tag things (see MWOAuthAPISetup::onRecentChange_save), so if that hook doesn't get called for the dummy edit then OAuth won't tag it.

The next step here would be to identify (or add) a hook that is called when these dummy edits are created but not saved as recent changes, so we can hook that too. I'm not terribly familiar with the uploading code path, so if you are and can point to where the dummy edit gets created that would be helpful. Otherwise I'll try to remember to track it down later.[1]

[1]: (although what'll probably happen then is that I'll forget until Andre pings us in a few months asking if there's any progress)

Bawolff added a comment.Via ConduitMar 22 2014, 12:06 AM

It's created with a line like:

$status = $wikiPage->doEditContent(

in LocalFile::recordUpload2. (A slightly different but similar code path is used for re-uploads)

Could perhaps add $flags to NewRevisionFromEditComplete hook.

Anomie added a comment.Via ConduitMar 24 2014, 3:27 PM

Thanks for that, now I see where to look in the code.

NewRevisionFromEditComplete looks like it'd probably be a good hook to use since it seems to be called from a few other relevant code paths too that directly insert the revision. Unfortunately, it also looks like you're right that we'd need to add some sort of flagging to the hook (although that seems a bit "ugh" to me considering every other caller would probably have to fake it), or else fix ChangeTags::addTags so that calling ChangeTags::addTags( $tags, null, $rev_id, null ) then ChangeTags::addTags( $tags, $rc_id, $rev_id, $log_id ) will update the change_tag table with the $rc_id and $log_id instead of just completely ignoring the second call.

Ricordisamoa added a subscriber: Ricordisamoa.Via WebFeb 12 2015, 9:59 AM
Ricordisamoa changed the title from "Dummy edits not tagged by oAuth" to "Dummy edits not tagged by OAuth".Via WebMar 1 2015, 6:48 AM
Ricordisamoa edited the task description. (Show Details)
Ricordisamoa set Security to None.
bd808 triaged this task as "Low" priority.Via WebMar 6 2015, 1:39 AM
bd808 added a subscriber: bd808.
Deskana moved this task to Tool User wants on the MediaWiki-extensions-OAuth workboard.Via WebMar 6 2015, 10:56 PM
Tgr changed the title from "Dummy edits not tagged by OAuth" to "The edit to the description page made during file upload is not tagged by OAuth".Via WebJun 23 2015, 7:02 AM

Add Comment