Page MenuHomePhabricator

When hooks prevent file deletion, reason isn't shown
Open, Needs TriagePublicBUG REPORT


Steps to reproduce:
Add a hook handler for the ArticleDelete hook that prevents deleting pages under some conditions (for reproducing on the beta cluster I used an abuse filter that prevents deletions by me,

Try to delete a non-file page, and see an error message explaining the failure (deleting gave me the standard abusefilter disallowed message, "Your action has triggered the Abuse Filter An automated filter has identified this edit as potentially unconstructive, and it has been disallowed. If this edit is constructive, please report this error.")

Try to delete a file, and see an error message that does not include the specific failure reason set by an extension (deleting gave me the cannotdelete interface message, but not the abusefilter disallowed message)

Expected result:
Whatever reason given by a hook that prevents file deletion should be shown, just like for non-files

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
DannyS712 changed the subtype of this task from "Task" to "Bug Report".Aug 22 2021, 10:55 AM
DannyS712 moved this task from Unsorted to Reports on the User-DannyS712 board.
DannyS712 added a subscriber: Daimona.

@Daimona I see at T288282: Build the page delete UI from DeleteAction, not Article that there will be some cleanup of FileDeleteForm - could this be potentially included?

Any warning from the deletion status for the article is ignored. Unsure if this could be included in T288758, I guess it might make sense to do so if the relevant code needs to be touched anyway.

Locally testing, I found that just adding a $status->merge( $deleteStatus ); is enough to show the error, though its not very nicely formatted