https://bugzilla.wikimedia.org/show_bug.cgi?id=16626

           Summary: Delete API request does not handle correctly empty
                    "reason" param.
           Product: MediaWiki
           Version: 1.14-svn
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: Normal
         Component: API
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


The API delete feature does not work like awaited with an empty "reason"
parameter.
The bug is reproducible with the SVN r44509.

What I do:
* Call the delete API function with following parameters:
            'action' => 'delete',
            'title' => $my_image.ext,
            'token' => $my_valid_edit_token,
            'format' => 'xml'

What I get:
* the HTTP response looks like following:
            <?xml version="1.0"?><api><error
code="internal_api_error_DBQueryError" info="Database query error">

            #0 /var/www/mirror/fr/includes/db/Database.php(591):
Database-&gt;reportQueryError('Column 'log_com...', 1048, 'INSERT  INTO `l...',
'LogPage::saveCo...', false)
            #1 /var/www/mirror/fr/includes/db/Database.php(1311):
Database-&gt;query('INSERT  INTO `l...', 'LogPage::saveCo...')
            #2 /var/www/mirror/fr/includes/LogPage.php(73):
Database-&gt;insert('logging', Array, 'LogPage::saveCo...')
            #3 /var/www/mirror/fr/includes/LogPage.php(316):
LogPage-&gt;saveContent()
            #4 /var/www/mirror/fr/includes/Article.php(2475):
LogPage-&gt;addEntry('delete', Object(Title), NULL, Array)
            #5 /var/www/mirror/fr/includes/FileDeleteForm.php(112):
Article-&gt;doDeleteArticle(NULL, false, '3')
            #6 /var/www/mirror/fr/includes/api/ApiDelete.php(165):
FileDeleteForm::doDelete(Object(Title), Object(LocalFile), NULL, NULL, false)
            #7 /var/www/mirror/fr/includes/api/ApiDelete.php(76):
ApiDelete::deleteFile('74b91b5b5aec710...', Object(Title), NULL, NULL, false)
            #8 /var/www/mirror/fr/includes/api/ApiMain.php(427):
ApiDelete-&gt;execute()
            #9 /var/www/mirror/fr/includes/api/ApiMain.php(260):
ApiMain-&gt;executeAction()
            #10 /var/www/mirror/fr/includes/api/ApiMain.php(244):
ApiMain-&gt;executeActionWithErrorHandling()
            #11 /var/www/mirror/fr/api.php(77): ApiMain-&gt;execute()
            #12 {main}

            </error></api>
* The image is deleted but it is impossible to restore it.

What I want:
* No API error
* A "restorable" image

Remarks:
* If I give a non-empty string reason, it works like I want.
* I suppose the code does not work correctly with an non-empty string reason
and is not able to insert a log entry in the old images table or something like
that, and for this reason the image is forever lost (in the DB).


-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to