-
Notifications
You must be signed in to change notification settings - Fork 350
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
Integration with Laravel: Select Image and use in a simple textfield #438
Comments
Thanks for sharing. For debugging you can change the lib source to Would you integrate the proposed fix into the dedicated wiki page ? https://github.com/simogeo/Filemanager/wiki/Integrate-the-Filemanager-with-Laravel According to you is there another way to make this work with laravel without making any changes to the FM code ? |
Hi, I had no trouble integrating FileManager with Laravel for Image upload and with CkEditor. However I could not use it to select an image to use get the url in an input textfield.
FileManager opened in the new window, but on clicking the select button I got the following error in chrome dev tool:
filemanager.min.js:24 Uncaught TypeError: Cannot set property 'value' of null
I checked the following :
I also cloned bestmomo's (https://github.com/bestmomo) example:
https://github.com/bestmomo/laravel5-example
and tried to follow his method but he did not use image selection.
After much searching I realized that the issue was with laravel treating the command:
OpenServerBrowser(url) as a call to a route, in this case(url).
Eventually, I got it to work by changing the line:
parent.document.getElementById($.urlParam('field_name')).value = url;
in filemanager.js:652 to
parent.window.opener.document.getElementById($.urlParam('field_name')).value = url;
I also added the function : self.close() like so:
if($.urlParam('field_name'))
{
parent.window.opener.document.getElementById($.urlParam('field_name')).value = url;
self.close();
}
The text was updated successfully, but these errors were encountered: