Make WordPress Core

Opened 5 years ago

Last modified 4 years ago

#47900 new defect (bug)

Error on update MCE Views in gutenberg block "Classic Editor"

Reported by: vjik's profile vjik Owned by:
Milestone: Future Release Priority: normal
Severity: major Version: 5.2.2
Component: Editor Keywords: needs-patch
Focuses: administration Cc:

Description

By steps:

  • Install new site on WordPress 5.2.2.
  • Create new page.
  • Add editor block "Classic".
  • Add media gallery into classic editor with 2+ images.
  • Open edit gallery window.
  • Switch to another tab in the browser.
  • Little wait...
  • Back to tab with WordPress.
  • Any change in "edit gallery window" and click "Update gallery".
  • Gallery do not update and error in browser console.

Error in browser console:

wp-tinymce.js?ver=4940-20190515:3 Uncaught TypeError: Failed to execute 'setStart' on 'Range': parameter 1 is not of type 'Node'.
    at wp-tinymce.js?ver=4940-20190515:3
    at Object.map (wp-tinymce.js?ver=4940-20190515:3)
    at Object.select (wp-tinymce.js?ver=4940-20190515:3)
    at mce-view.min.js?ver=5.2.2:1
    at Function.s.findKey (underscore.min.js?ver=1.8.3:1)
    at Function.s.find.s.detect (underscore.min.js?ver=1.8.3:1)
    at N.d.update (mce-view.min.js?ver=5.2.2:1)
    at mce-view.min.js?ver=5.2.2:1
    at N.d.<anonymous> (mce-view.min.js?ver=5.2.2:1)
    at s (backbone.min.js?ver=1.2.3:1)

I think reason of problem in the following: after open "edit gallery window" gutenberg block updated, and after click "Update gallery" node for update (use in "update" function in mce-views) no longer in the document.

The problem is also observed in other plugins that use MCE Views for pretty view shortcodes.

Change History (6)

#1 follow-up: @noisysocks
4 years ago

  • Keywords reporter-feedback added

Hi @vjik. Having trouble recreating this issue. Are you still seeing it in the latest WordPress 5.6 beta? Does it happen when inserting a gallery into the post editor while using the Classic Editor plugin?

Last edited 4 years ago by noisysocks (previous) (diff)

#2 in reply to: ↑ 1 @vjik
4 years ago

Replying to noisysocks:

Hi @vjik. Having trouble recreating this issue. Are you still seeing it in the latest WordPress 5.6 beta? Does it happen when inserting a gallery into the post editor while using the Classic Editor plugin?

Hello! In WP5.6 visually, everything works. But in console has error:

media-views.min.js?ver=5.6-beta3-49536:2 Uncaught TypeError: Cannot read property 'args' of undefined
    at i.<anonymous> (media-views.min.js?ver=5.6-beta3-49536:2)
    at f (underscore.min.js?ver=1.8.3:2)

#3 follow-up: @noisysocks
4 years ago

@vjik: What browser are you using?

#4 in reply to: ↑ 3 @vjik
4 years ago

Replying to noisysocks:

@vjik: What browser are you using?

Windows 10, Google Chrome Version 86.0.4240.183 (Official Build) (64-bit)

#5 @noisysocks
4 years ago

  • Keywords needs-patch added; reporter-feedback removed
  • Milestone changed from Awaiting Review to Future Release

Thanks @vjik. I can confirm the error message. Looks like it happens in Firefox too.

this.collection.mirroring is undefined

I am not sure if it is a block editor bug or a Core bug.

#6 @webinista
4 years ago

It's still happening for me in 5.6. It seems to originate with the announceSearchResults function in wp-includes/js/media-views.min.js.

Changing:

if ( this.collection.mirroring.args.s )

to:

if ( 
    this.collection.hasOwnProperty('mirroring') &&
    this.collection.mirroring.args.s
)

resolved my particular issue.

Note: See TracTickets for help on using tickets.