[wp-trac] [WordPress Trac] #49178: Upload image issue after deleting image from edit image page

WordPress Trac noreply at wordpress.org
Tue Jun 1 20:11:58 UTC 2021


#49178: Upload image issue after deleting image from edit image page
--------------------------+---------------------
 Reporter:  rnitinb       |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  5.8
Component:  Media         |     Version:  5.3.2
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+---------------------

Comment (by desrosj):

 So I did some testing with this today. Here's what I found.

 While using list view for the media library, when an image is deleted a
 message is displayed correctly for all scenarios and the query variable is
 correctly removed from the URL. This happens because `deleted`
 [https://core.trac.wordpress.org/browser/branches/5.7/src/wp-
 includes/functions.php#L1176 is already returned in the list returned by]
 `wp_removable_query_args()`, and `wp_admin_canonical_url()` changes the
 browser's location to a URL with those parameters removed. The user is
 always allowed to update a new image because it requires navigating to the
 `wp-admin/media-new.php` page.

 When using the media gallery in grid view, no message is displayed when an
 image is deleted within any user flow (from the individual image edit
 screen, or the image overlay). `deleted` is only added when deleting from
 single attachment edit screen, and the parameter remains when redirected
 to the Media Library.

 It appears to be intentional that the parameter is not removed, as the
 call to `wp_admin_canonical_url()` was removed in [34256] to prevent any
 query args required by the grid view from being removed. I
 [https://core.trac.wordpress.org/browser/trunk/src/wp-admin/upload.php#L29
 removed this line] to see if it fixed the issue. It did remove the
 `deleted` query arg, but I still was not shown the visual confirmation
 that an image was being uploaded, and no confirmation that an image was
 deleted was shown.

 I'm still not sure why the `deleted` parameter would prevent the UI from
 functioning properly. Even though no visual elements or progress is
 displayed to the user, the image does upload successfully.

 I'm also curious as to historical reasons behind the messages not being
 displayed in grid view. Did these ever display correctly? Or was it by
 design that no admin messages were displayed? The only one I can think of
 seeing recently is when an upload fails. @mikeschroder or @joemcgill do
 you have any knowledge there?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/49178#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list