[wp-trac] [WordPress Trac] #54069: Media title change in "Attachment Details" dialog opened via Media Library Grid View is not informing API/plugins properly

WordPress Trac noreply at wordpress.org
Fri Sep 3 10:52:50 UTC 2021


#54069: Media title change in "Attachment Details" dialog opened via Media Library
Grid View is not informing API/plugins properly
--------------------------+-----------------------------
 Reporter:  abitofmind    |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Media         |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 **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 [https://wordpress.org/plugins
 /media-file-renamer/ 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 [https://wordpress.org/support/topic/no-file-renaming-if-
 title-changed-via-media-library-thumbview-edit-popup/#post-14834202
 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 [https://wordpress.org/support/article/media-library-
 screen/#media-library-list-view 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
 [https://wordpress.org/plugins/media-file-renamer/ Media File Renamer]
 plugin config:
  * Advanced > Fields Syncing > Slug/Permalink: `[√] Sync with filename`

 **❌ Reproduction II**
 1) Media Library in [https://wordpress.org/support/article/media-library-
 screen/#media-library-grid-view Grid View]
 2) Click on a media thumbnail
 3) A dialog/popup opens, entitled [https://wordpress.org/support/article
 /media-library-screen/#attachment-details 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 [https://wordpress.org/plugins/media-file-
 renamer/ Media File Renamer]'s sync settings are active (title, filename,
 slug) kick in here in this editing method as well.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54069>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list