WordPress.org

Make WordPress Core

Opened 8 weeks ago

Last modified 7 weeks ago

#54069 new defect (bug)

Media title change in "Attachment Details" dialog opened via Media Library Grid View is not informing API/plugins properly

Reported by: abitofmind Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Media Keywords:
Focuses: Cc:

Description

Problem:
If WordPress offers different UIs to edit media titles, then all those should properly inform the respective plugin/event APIs about that change. It seems there is a discrepancy, in one place it works, in the other not. See the reproductions.

Environment / How I discovered the bug
I noticed this bug when using the plugin Media File Renamer 5.2.4 on WordPress 5.8. What I observed is very likely a bug in WordPress and not from the plugin according to the support reply of the plugin developer @TigrouMeow:

Unfortunately, I think the problem is on the Media Library ThumbView Edit Popup side [remark: The documentation calls this "Media grid view" and "Attachment details dialog" respectively]. Media File Renamer renames files based on a title change depending on specific actions in WordPress, and those actions can be also fired by other plugins. Since this plugin is mimicking the Edit Media Page of WP, it should also includes the actions. Otherwise, that will break not only the process of my plugin, but also many more.

✅ Reproduction I
1) Media Library in List View
2) Hover over a media post > Click “Edit”
3) You get to “Edit Media”
4) Change the “title”
4) Be sure that the “Renamer” widget has the file name not locked
5) In the “Save” widget click “Update”

  • Outcome as expected: The filename is changed accordingly.
  • The slug is also changed from the filename change, due to the Media File Renamer plugin config:
    • Advanced > Fields Syncing > Slug/Permalink: [√] Sync with filename

❌ Reproduction II
1) Media Library in Grid View
2) Click on a media thumbnail
3) A dialog/popup opens, entitled Attachment details
4) Change the “title”
5) Optional step for observation purposes: Click into the next field, or TAB into the next field. You see a saving indicator.
6) Close the popup. (If you skipped 5, you very briefly see the saving indicator while the popup closes)

  • Actual: The title is changed, the filename not!
  • Expected: Whichever of Media File Renamer's sync settings are active (title, filename, slug) kick in here in this editing method as well.

Change History (1)

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


7 weeks ago

Note: See TracTickets for help on using tickets.