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

Description

Details

Reference
bz62908
bzimport set Reference to bz62908.
bzimport added a subscriber: Unknown Object (MLST).
Bawolff created this task.Mar 21 2014, 1:58 AM

(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)

It's created with a line like:

$status = $wikiPage->doEditContent(
        $content,
        $comment,
        EDIT_NEW | EDIT_SUPPRESS_RC,
        false,
        $user
);

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

Could perhaps add $flags to NewRevisionFromEditComplete hook.

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 changed the title from "Dummy edits not tagged by oAuth" to "Dummy edits not tagged by OAuth".Mar 1 2015, 6:48 AM
Ricordisamoa edited the task description. (Show Details)
Ricordisamoa set Security to None.
bd808 triaged this task as "Low" priority.Mar 6 2015, 1:39 AM
bd808 added a subscriber: bd808.
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".Jun 23 2015, 7:02 AM

Add Comment