upload icon indicating copy to clipboard operation
upload copied to clipboard

Add deletion of Imgur uploads

Open tipa opened this issue 1 year ago • 0 comments

Bug Report

Current Behavior When using the Imgur image upload, those files cannot be deleted any more Currently, this is not implemented: https://github.com/FriendsOfFlarum/upload/blob/e8e7f9f9f145f26a03741b39273a5736acd2c72e/src/Adapters/Imgur.php#L81-L93

The Imgur deletion API for anonymous image uploads (as used in this plugin) requires the deleteHash, which is returned upon image upload

At the moment, the plugin does not store this value: https://github.com/FriendsOfFlarum/upload/blob/e8e7f9f9f145f26a03741b39273a5736acd2c72e/src/Adapters/Imgur.php#L64-L72

Expected Behavior Users (or at least admins) can delete images that have been uploaded using the Imgur integration

Environment

  • Flarum version: 1.8.8
  • Extension version: 1.5.5

Possible solution(s) I don't know the internals of this plugin, but maybe the deleteHash could be stored in the remote_id instead of the id (unless the remote_id is used for some other purpose): https://github.com/FriendsOfFlarum/upload/blob/e8e7f9f9f145f26a03741b39273a5736acd2c72e/src/Adapters/Imgur.php#L71

Additional Context Related issue: https://github.com/FriendsOfFlarum/upload/issues/290

tipa avatar Nov 14 '24 12:11 tipa