Opened 7 years ago
Last modified 3 years ago
#47545 assigned defect (bug)
Getting undefined wp.media.frame.state() after click on featured image preview
| Reported by: | nlemsieh | Owned by: | antpb |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Media | Version: | 5.2.1 |
| Severity: | normal | Keywords: | reporter-feedback |
| Cc: | Focuses: | javascript |
Description
In WP 5.x:
- When I click on the featured image preview the wp.media.frame.state().get('selection') is undefined.
- But, when I click on the "Replace image" button wp.media.frame.state().get('selection') returns the selected attachment object (which is the expected behaviour).
While in WP 4.x it returns correctly the attachment when I click on the featured image preview.
Change History (9)
This ticket was mentioned in Slack in #core-media by desrosj. View the logs.
7 years ago
This ticket was mentioned in Slack in #core-media by antpb. View the logs.
4 years ago
#5
@
4 years ago
- Milestone Awaiting Review → 6.2
- Owner set to
- Status new → assigned
This seems related to https://core.trac.wordpress.org/ticket/53765
the frame should initialize with the selected image selected.
Moving this to 6.2 to investigate and fix.
This ticket was mentioned in Slack in #core by mukeshpanchal27. View the logs.
3 years ago
#7
@
3 years ago
This ticket was discussed during the recent bug scrub. It looks like it's unlikely that work will be done on this during the 6.2 cycle.
@antpb Is this still possible to land in 6.2, or should it be moved to Future Release for now?
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
I'm able to reproduce this and it looks to me like the frame state is getting destroyed once the featured image has been set and the modal is closed. @nlemsieh are you suggesting that the state should be recreated when the modal is reopened by clicking on the featured image in the sidebar?