• when you install both “instant images” with “the paste” plugin, they are incompatible together. The paste allows you to copy/paste images directly into the editor. It looks like this has something to do with how the two plugins inject menus into the media panels.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    @oferlaor I can’t replicate an issue with The Paste and Instant Images.

    How I tested.

    1. Both plugin installed and activated.
    2. Goto Media > Library > Copy & Paste
    3. Paste image
    4. Save image

    No errors, new image is inserted into media library.

    Let me know if I should be testing another way.

    Thread Starter oferlaor

    (@oferlaor)

    now try going into a post, press the “add Media” button. That’s what exploded last time I tried this…

    Plugin Author Darren Cooney

    (@dcooney)

    I did that as well. No issues.
    happy to dig in more if you could possibly provide a video screenshots.

    Thread Starter oferlaor

    (@oferlaor)

    my wordpress is in Hebrew (not sure if a screenshot will help you because of it, but I don’t think it’s the root cause). With the latest version of both plugins, I get this error after clicking “add Media” button on the new post page.

    Uncaught TypeError: Cannot read properties of undefined (reading 'uploader')
        at n.initialize (the-paste.js:148:63)
        at h.View (backbone.min.js?ver=1.4.1:2:14648)
        at n.constructor (wp-backbone.min.js?ver=77df236a32da308d12654bbcacfa5fc2:2:2602)
        at n.constructor (media-views.min.js?ver=77df236a32da308d12654bbcacfa5fc2:2:106750)
        at new n (backbone.min.js?ver=1.4.1:2:23485)
        at n.browseContent (media-views.min.js?ver=77df236a32da308d12654bbcacfa5fc2:2:74798)
        at p (backbone.min.js?ver=1.4.1:2:3700)
        at f (backbone.min.js?ver=1.4.1:2:3497)
        at a (backbone.min.js?ver=1.4.1:2:692)
        at e.trigger (backbone.min.js?ver=1.4.1:2:3380)

    It looks like it has to do with a conflict of trying to add the paste button to the media upload modal and not succeeding to inject the “copy & paste” tab/button.

    in order to resolve it, I made the following patch in wp-content/plugins/the-paste/js/admin/the-paste.js

    I unminified it and removed this block of code (line 746 after de-minification)

    /*
                        },
                        this.controller instanceof wp.media.view.MediaFrame.Select || wp.media.thepaste.supports.paste && (e = new wp.media.view.Button({
                                text: n.copy_paste,
                                className: "grabber-button",
                                priority: -64,
                                click: function () {
                                    t.thepaste.active = t.thepaste.paste,
                                    t.thepasteOpen(n.copy_paste)
                                }
                            }), this.thepaste.paste.grabber = new wp.media.thepaste.view.DataSourceImageGrabber({
                                controller: this.controller,
                                grabber: wp.media.thepaste.view.Pasteboard,
                                wpuploader: this.controller.uploader.uploader.uploader
                            }), this.toolbar.set("pasteModeButton", e.render()))
    */
    Thread Starter oferlaor

    (@oferlaor)

    @dcooney were you able to see the problem?

    Plugin Author Darren Cooney

    (@dcooney)

    No, sorry. All these errors appear related to the_paste JS.

    Thread Starter oferlaor

    (@oferlaor)

    you are right, no comment from the author, though ??

    Plugin Author Darren Cooney

    (@dcooney)

    Yea, If I could replicate this over here I’d attempt a fix.

    What other plugins are installed? Possible to reduce to only these two and see if the issue persists?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘instant images breaks “the paste” plugin’ is closed to new replies.