Opened 11 days ago
Last modified 20 hours ago
#65513 new defect (bug)
Media Library modal shows wrong count on first upload and does not reset after image deletion
| Reported by: | dilipbheda | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Media | Version: | |
| Severity: | normal | Keywords: | needs-test-info has-screenshots has-patch has-unit-tests |
| Cc: | Focuses: | administration |
Description
I found the following bugs in media uploads while user upload first time.
Bug 1: Wrong media count when uploading the first image
After uploading the first image through the Featured Image modal, the Media Library tab displays "Showing 1 of 2 media items" instead of "Showing 1 of 1 media items." The count is off by one on the initial upload.
Steps to reproduce:
Open any Page or Post in the editor.
Click "Set featured image" to open the Featured Image modal.
On the Upload files tab, upload one image (library was empty before).
Switch to the Media Library tab.
Expected: "Showing 1 of 1 media items"
Actual: "Showing 1 of 2 media items"
Bug 2: Modal does not reset after deleting the uploaded image
After clicking "Delete permanently" and confirming the deletion inside the Featured Image modal, the Attachment Details sidebar continues to display the deleted image's metadata (filename, date, file size, dimensions, Edit Image / Delete permanently links). The "Set featured image" button also remains active as if an item is still selected.
Steps to reproduce:
Open the Featured Image modal with at least one image in the library.
Select the image — Attachment Details populate in the right sidebar.
Click "Delete permanently" in the sidebar and confirm the browser dialog.
Expected: Attachment Details panel clears, selection state resets, "Set featured image" button becomes disabled.
Actual: Attachment Details panel still shows the deleted image's data. "Set featured image" button remains enabled.
Here is I attached record screen video for better understanding: https://tinyurl.com/26ocs6r4
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)