Make WordPress Core

Opened 5 years ago

Last modified 4 years ago

#45886 assigned defect (bug)

Media modal .edit-attachment link opens in new tab rather than in modal

Reported by: statelessstudio's profile statelessstudio Owned by: antpb's profile antpb
Milestone: Future Release Priority: normal
Severity: normal Version: 5.0.2
Component: Media Keywords: needs-patch
Focuses: javascript Cc:


Using the JavaScript API creates a link "Edit Image" (.edit-attachment) in the right sidebar of the Media modal. Expected behavior would be to open the "Edit Image" modal, as does the Featured Image media modal.

However, the custom Media modal does not behave consistently with the Featured Image modal - the .edit-attachment link opens in a new tab instead of the modal - which is both unintuitive and frustrating to end-users.

The console does not display any warnings or errors.

Custom media modal as documented:

As a side note, I have noticed similar behavior in the WordPress Media page:

Media (Admin Sidebar) -> Click a picture -> Edit more Details

This also fails to open the modal - and opens in the current page instead.

Attachments (1) (1.8 KB) - added by statelessstudio 5 years ago.
Source code to recreate issue

Download all attachments as: .zip

Change History (8)

5 years ago

Source code to recreate issue

#1 @joemcgill
5 years ago

  • Focuses javascript added
  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 5.3

Hi @statelessstudio,

I can confirm that I am able to reproduce this behavior, but it seems to happen even in the featured image panel of the new block editor. I've not noticed this before, so I'm wondering if this is a regression in one of the last few releases. I'm going to add this to the next release milestone to investigate.

This ticket was mentioned in Slack in #core by david.baumwald. View the logs.

5 years ago

#3 @antpb
5 years ago

  • Milestone changed from 5.3 to 5.4

It's looking a little late in the 5.3 release cycle to tackle this. I think we should move this to 5.4. Still a bit of investigation needed here.

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

4 years ago

#5 @antpb
4 years ago

  • Owner set to antpb
  • Status changed from new to assigned

Setting myself as owner so that I can keep visibility into this issue as I work on tasks similar to this one. Will provide an update to let everyone know if this is possible in the 5.4 timeline. Thanks!

#6 @audrasjb
4 years ago

  • Milestone changed from 5.4 to Future Release


This ticket still needs a patch.

With 5.4 Beta 3 approaching and the Beta period reserved for bugs introduced during the cycle, this is being moved to Future Release. If any maintainer or committer feels this should be included or wishes to assume ownership during a specific cycle, feel free to update the milestone accordingly.

#7 @Mista-Flo
4 years ago

Hum, I'm not sure to understand the issue here.

I'm currently running the last version on trunk. I am on Media Library grid, I click on a image to open the popup modal, I click on Edit image button and it loads the edit image modal properly. If I click on Edit more details link, I am redirected to the attachment edit page which seems normal.

Then, in edit post page, if I add a media through the popup or the featured image, I can click on Edit image link and it loads the popup properly, I am not redirected anywhere.

Did I miss some steps to reproduce?

Note: See TracTickets for help on using tickets.