bueltge / multisite-global-media

Share a media library across the WordPress Multisite network
GNU General Public License v2.0
216 stars 50 forks source link

Restoring image edit for current blog, preserving global media tab editing lock #133

Open darkfire56j opened 3 years ago

darkfire56j commented 3 years ago

I was struggling with a bug. All is fine with your plugin except one thing:

Enabling this plugin in my wordpress version (latest at today) suddenly introduce a bug: clicking in "edit image" for local blog images (I mean the regular Browse tab, not yours) does not work.

I fixed this changing your global-media.js file and reintroducing this to Select extend:

this.on('content:render:edit-image', this.editImageContent, this); and then:

editImageContent: function() {
    var image = this.state().get('image'),
        view = new wp.media.view.EditImage( { model: image, controller: this } ).render();

    this.content.set( view );

    // After creating the wrapper view, load the actual editor via an Ajax call.
    view.loadEditor();
},

I share this bugfix with you because I really appreciate your work <3

bueltge commented 1 year ago

Thanks @darkfire56j Would you create a fix for that, creating of a Pull Request?