Page MenuHomePhabricator

revisiondelete API module works with the target without namespace but logs the wrong title
Open, LowestPublic


Please go to this file on hywiki File:Ջուդիթ Կրանց.jpg. The bot hided an old and large version of that file but according to the deletion log page it deleted the "Ջուդիթ Կրանց.jpg" page (without namespace). I'm using this API request to hide that version

    'action': 'revisiondelete',
    'target': title,
    'type': 'oldimage',
    'hide':' content',
    'ids': version,
    'reason':' Չօգտագործվող նիշք',
    'token': get_csrf_token(),
    'format': 'json'

Everything is fine when I'm hiding the image with my account (without using the API). Since it hides the correct thing, I'm assuming my API request is OK.

Event Timeline

What value were you using on title? 'File:Ջուդիթ Կրանց.jpg' ? Or perhaps something like just 'Ջուդիթ Կրանց.jpg' ?

@Platonides it is without the namespace :/ but in that case I don't understand why this works at all :/

Probably because the ids themselves would be everything needed to hide them.

I think the revisiondelete action should either skip/ignore that parameter, or error out if the ids don't belong to that title.

BTW, it doesn't work when I omit the 'target' parameter. A little weird but I'm fine with it now (since it works fine with correct parameters). Sorry for taking your time. @Platonides thanks for your help.

Ashot1997 triaged this task as Lowest priority.Aug 10 2020, 8:11 PM
Platonides renamed this task from Deletion log is without namespace on hywiki to revisiondelete API module works with the target without namespace but logs the wrong title.Aug 10 2020, 9:28 PM

Even Special:RevisionDelete would work when building up the wrong title in url, because oldimage means that this must be a file and not checked for the correct title. It also works with Media:, that is also bad and fragments the logs

File::normalizeTitle may help in that case or just show an error in api and special page