Opened 5 years ago
Last modified 22 months ago
#47545 assigned defect (bug)
Getting undefined wp.media.frame.state() after click on featured image preview
Reported by: | nlemsieh | Owned by: | antpb |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | 5.2.1 |
Component: | Media | Keywords: | reporter-feedback |
Focuses: | javascript | Cc: |
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.
5 years ago
This ticket was mentioned in Slack in #core-media by antpb. View the logs.
2 years ago
#5
@
2 years ago
- Milestone changed from Awaiting Review to 6.2
- Owner set to antpb
- Status changed from new to 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.
22 months ago
#7
@
22 months 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?
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?