Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with Media Library Folders #398

Closed
mplusb opened this issue Jun 17, 2020 · 5 comments
Closed

Not working with Media Library Folders #398

mplusb opened this issue Jun 17, 2020 · 5 comments
Labels
compatibility Incompatibility issues need testing

Comments

@mplusb
Copy link

mplusb commented Jun 17, 2020

https://wordpress.org/support/topic/not-working-with-media-library-folders/

Get the plugin here for testing: https://secure.helpscout.net/conversation/1196151658/27994?folderId=1289779

Media Library Folders Pro helps site administrators to organize their media files by allowing them to create folders and move files. For inserting files into posts and pages, the plugin adds a folder tree to the Wordpress media uploader popup. When the user clicks on a folder in the tree, the media popup should refresh its contents which will display the files in the selected folder. Normally that is accomplished with

wp.media.frame.content.get().collection.props.set({ignore: (+ new Date())});

But with your gallery popup, this line will cause: TypeError: wp.media.frame is undefined. Hopefully, you guys can provide us with the code that we can use to refresh the contents of the popup when the Modula gallery is in use.

The code Media Library Folders Pro uses to refresh the media uploader contents can be found in the media-library-plus-pro/js/mlfp-media.js file.

@mplusb mplusb added the compatibility Incompatibility issues label Jun 17, 2020
@AJerm
Copy link

AJerm commented Jun 19, 2020

Thanks for posting this Mihaela!
If you figure out a fix, if you could please post it here so I can manually apply it locally before your next update, as I've got 500 images that I've manually renamed and organised into folders for SEO purposes and have ready to add to various galleries on one site.
I'd love to be able to work on it over the weekend for my client if possible.
Thanks :)

@AJerm
Copy link

AJerm commented Jun 25, 2020

Any chance someone has managed to look at this yet?

@andyluak
Copy link
Contributor

andyluak commented Jul 3, 2020

@AJerm I found a solution to your problem . We were not able to fix it from our end because we have no action we can hook into . In media-library-plus-pro/js/mlfp-media.js at line 126 please add the following :

 if( typeof wp.media.frames.modula !== 'undefined' ){
    wp.media.frames.modula.content.get().collection.props.set({ignore: (+ new Date())});
 }
if( typeof wp.media.frame.content.get() == null ) {
    wp.media.frame.content.get().collection.props.set({ignore: (+ new Date())});
}

@AJerm
Copy link

AJerm commented Jul 3, 2020

You star, cheers @andyluak!

Will give that a go :)

@giucu91
Copy link
Contributor

giucu91 commented Jul 6, 2020

I'll close this.

@giucu91 giucu91 closed this as completed Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Incompatibility issues need testing
Projects
None yet
Development

No branches or pull requests

4 participants