WordPress.org

Make WordPress Core

Opened 8 weeks ago

Last modified 6 weeks ago

#51243 new defect (bug)

[JS] Exception when setting or trying to upload a featured image in a post

Reported by: cryptomilk Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.5.1
Component: Media Keywords: has-patch
Focuses: javascript Cc:

Description

I'm getting the following JS exception when trying to set or upload a featured image in a post. The editor then exits with an error message.

TypeError: this.obj._listeners is undefined
    Backbone 5
    t https://ig-klettern.org/wp-includes/js/media-views.min.js?ver=5.5:2
    dispose https://ig-klettern.org/wp-includes/js/media-views.min.js?ver=5.5:2
    dispose https://ig-klettern.org/wp-includes/js/media-views.min.js?ver=5.5:2
    remove https://ig-klettern.org/wp-includes/js/media-views.min.js?ver=5.5:2
    Underscore 3
    Backbone 2
    remove https://ig-klettern.org/wp-includes/js/media-views.min.js?ver=5.5:2
    Underscore 3
    Backbone 2
    remove https://ig-klettern.org/wp-includes/js/media-views.min.js?ver=5.5:2
    value https://ig-klettern.org/wp-includes/js/dist/media-utils.min.js?ver=9ad24b42cc69f241229ded4dc61409fb:2
    Ii https://ig-klettern.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:104
    $g https://ig-klettern.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:105
    bh https://ig-klettern.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:105
    ah https://ig-klettern.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:109
    Ti https://ig-klettern.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:145
    unstable_runWithPriority https://ig-klettern.org/wp-includes/js/dist/vendor/react.min.js?ver=16.9.0:26
    Ma https://ig-klettern.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:52
    Ia https://ig-klettern.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:140
    ze https://ig-klettern.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:118
    mg https://ig-klettern.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:53
    unstable_runWithPriority https://ig-klettern.org/wp-includes/js/dist/vendor/react.min.js?ver=16.9.0:26
    Ma https://ig-klettern.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:52
    mg https://ig-klettern.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:52
    V https://ig-klettern.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:52
    Sb https://ig-klettern.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:213
    Mg https://ig-klettern.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:85
    e https://ig-klettern.org/wp-includes/js/dist/data.min.js?ver=75f90354ddff4acd5b0b4026454037ca:2
    t https://ig-klettern.org/wp-includes/js/dist/data.min.js?ver=75f90354ddff4acd5b0b4026454037ca:2
    o https://ig-klettern.org/wp-includes/js/dist/data.min.js?ver=75f90354ddff4acd5b0b4026454037ca:2
    o https://ig-klettern.org/wp-includes/js/dist/data.min.js?ver=75f90354ddff4acd5b0b4026454037ca:2
    b https://ig-klettern.org/wp-includes/js/dist/data.min.js?ver=75f90354ddff4acd5b0b4026454037ca:2
    p https://ig-klettern.org/wp-includes/js/dist/data.min.js?ver=75f90354ddff4acd5b0b4026454037ca:2
    s Redux
    I https://ig-klettern.org/wp-includes/js/dist/data.min.js?ver=75f90354ddff4acd5b0b4026454037ca:2
    N https://ig-klettern.org/wp-includes/js/dist/data.min.js?ver=75f90354ddff4acd5b0b4026454037ca:2
    default https://ig-klettern.org/wp-includes/js/dist/block-editor.min.js?ver=6d92bbc61845b6652c64f83c59aee1f0:12
    t https://ig-klettern.org/wp-includes/js/dist/block-editor.min.js?ver=6d92bbc61845b6652c64f83c59aee1f0:7
    s https://ig-klettern.org/wp-includes/js/dist/data.min.js?ver=75f90354ddff4acd5b0b4026454037ca:2
    he https://ig-klettern.org/wp-includes/js/dist/rich-text.min.js?ver=a4056cfcb2aec8ceb3c8e8935dfd0bc4:7
react-dom.min.js:103:487
    ve https://ig-klettern.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:103
    callback https://ig-klettern.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:114
    yg https://ig-klettern.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:62
    xg https://ig-klettern.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:61
    Ti https://ig-klettern.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:148
    unstable_runWithPriority https://ig-klettern.org/wp-includes/js/dist/vendor/react.min.js?ver=16.9.0:26
    Ma https://ig-klettern.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:52
    Ia https://ig-klettern.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:140
    ze https://ig-klettern.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:118
    mg https://ig-klettern.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:53
    unstable_runWithPriority https://ig-klettern.org/wp-includes/js/dist/vendor/react.min.js?ver=16.9.0:26
    Ma https://ig-klettern.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:52
    mg https://ig-klettern.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:52
    V https://ig-klettern.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:52
    Sb https://ig-klettern.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:213
    Mg https://ig-klettern.org/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.9.0:85
    e https://ig-klettern.org/wp-includes/js/dist/data.min.js?ver=75f90354ddff4acd5b0b4026454037ca:2
    t https://ig-klettern.org/wp-includes/js/dist/data.min.js?ver=75f90354ddff4acd5b0b4026454037ca:2
    o https://ig-klettern.org/wp-includes/js/dist/data.min.js?ver=75f90354ddff4acd5b0b4026454037ca:2
    o https://ig-klettern.org/wp-includes/js/dist/data.min.js?ver=75f90354ddff4acd5b0b4026454037ca:2
    b https://ig-klettern.org/wp-includes/js/dist/data.min.js?ver=75f90354ddff4acd5b0b4026454037ca:2
    p https://ig-klettern.org/wp-includes/js/dist/data.min.js?ver=75f90354ddff4acd5b0b4026454037ca:2
    s Redux
    I https://ig-klettern.org/wp-includes/js/dist/data.min.js?ver=75f90354ddff4acd5b0b4026454037ca:2
    N https://ig-klettern.org/wp-includes/js/dist/data.min.js?ver=75f90354ddff4acd5b0b4026454037ca:2
    default https://ig-klettern.org/wp-includes/js/dist/block-editor.min.js?ver=6d92bbc61845b6652c64f83c59aee1f0:12
    t https://ig-klettern.org/wp-includes/js/dist/block-editor.min.js?ver=6d92bbc61845b6652c64f83c59aee1f0:7
    s https://ig-klettern.org/wp-includes/js/dist/data.min.js?ver=75f90354ddff4acd5b0b4026454037ca:2
    he https://ig-klettern.org/wp-includes/js/dist/rich-text.min.js?ver=a4056cfcb2aec8ceb3c8e8935dfd0bc4:7
Uncaught TypeError: r is null
    Ce https://ig-klettern.org/wp-includes/js/dist/rich-text.min.js?ver=a4056cfcb2aec8ceb3c8e8935dfd0bc4:7
    fe https://ig-klettern.org/wp-includes/js/dist/rich-text.min.js?ver=a4056cfcb2aec8ceb3c8e8935dfd0bc4:7
    he https://ig-klettern.org/wp-includes/js/dist/rich-text.min.js?ver=a4056cfcb2aec8ceb3c8e8935dfd0bc4:7
rich-text.min.js:7:29619

The following patch fixes the issue for me:

diff -u wp-includes/js/backbone.js.orig wp-includes/js/backbone.js
--- wp-includes/js/backbone.js.orig     2020-09-04 11:34:27.333611546 +0200
+++ wp-includes/js/backbone.js  2020-09-04 11:35:31.813714069 +0200
@@ -374,7 +374,7 @@
   // Cleans up memory bindings between the listener and the listenee.
   Listening.prototype.cleanup = function() {
     delete this.listener._listeningTo[this.obj._listenId];
-    if (!this.interop) delete this.obj._listeners[this.id];
+    if (!this.interop && this.obj._listeners) delete this.obj._listeners[this.id];
   };
 
   // Aliases for backwards compatibility.

Attachments (1)

51243.patch (564 bytes) - added by kishanjasani 8 weeks ago.
Add patch as @cryptomilk describe in his comment description. Add extra condition to check that the object is exist or not.

Download all attachments as: .zip

Change History (5)

#1 @kishanjasani
8 weeks ago

  • Keywords needs-patch added; has-patch removed

Hi @cryptomilk, Welcome to Core Trac.

@kishanjasani
8 weeks ago

Add patch as @cryptomilk describe in his comment description. Add extra condition to check that the object is exist or not.

#2 @SergeyBiryukov
8 weeks ago

  • Component changed from Administration to Media
  • Keywords has-patch added; needs-patch removed

#3 @cryptomilk
7 weeks ago

Ping? What is needed to get the patch integrated?

#4 @kishanjasani
6 weeks ago

Once it's tested by one of the committers then it will be integrated into the core.

Note: See TracTickets for help on using tickets.