Make WordPress Core

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's profile nlemsieh Owned by: antpb's profile 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)

#1 @afercia
5 years ago

  • Component changed from General to Media

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


5 years ago

#3 @joemcgill
5 years ago

  • Keywords reporter-feedback added

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?

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


2 years ago

#5 @antpb
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 @mukesh27
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?

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


22 months ago

#9 @costdev
22 months ago

  • Milestone changed from 6.2 to Future Release

As we're approaching 6.2 Beta 4 and this ticket doesn't have a patch, I'm moving this to Future Release.

Note: See TracTickets for help on using tickets.