The main ACF plugin causes a bug/conflict when trying to upload an image from the media library to another plugin option (the plugin is Slider Revolution from Codecanyon) – haven’t tried other plugin media library inserts nbut the issue is probably affecting other too. The Insert button remain un-clickable / blanked out unless the ACF plugin is deactivated in which case it works as anticipated. I would guess that as the deactivation of the ACF plugin resolves the issue that the problem probably resides here.
Can you please investigate and advise asap.
Seems it could well be ACF:-
event.returnValue is deprecated. Please use the standard event.preventDefault() instead. load-scripts.php?c=1&load%5B%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jq…:4
body.scrollLeft is deprecated in strict mode. Please use ‘documentElement.scrollLeft’ if in strict mode and ‘body.scrollLeft’ only if in quirks mode. load-scripts.php?c=1&load%5B%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jq…:304
body.scrollTop is deprecated in strict mode. Please use ‘documentElement.scrollTop’ if in strict mode and ‘body.scrollTop’ only if in quirks mode. load-scripts.php?c=1&load%5B%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jq…:304
Uncaught ReferenceError: acf is not defined
The last error in bold is flagged red.
Uncaught ReferenceError: acf is not defined will occur if any JS error occurs before ACF is instantiated.
Any JS error starts a snowball effect where all following JS gets the blame.
Your origional error talks about
Perhaps these errors are comming from another plugin / theme code. Feel free to seach the ACF input.js file, but I don’t believe these errors are coming from ACF.
That is from the error codes that I have pasted, but I would ask that you take a look as well – I’m not a script debugger and other things are likely at play here. Theme Punch (the Revolution Slider authors) identify a different script error relating to ACF (and also think it is ACF as it works fine once ACF is deactivated).
They took a screen grab of the error but it reads:-
ReferenceError: ACF is not defined
That relates directly to an ACF Conditional Logic field.
To confirm I used your assigned login and wen to change the background image of the existing Revolution Slider. To my surprise it worked on first attempt. To confirm I exited the media upload and trued again, but on the second attempt it didn’t work again with the same error in the script debugger:-
[Error] ReferenceError: Can’t find variable: acf
(anonymous function) (undefined, line 4)
Can you please go back in and try to replicate.
I need your plugin for this site (launching now) and another critical site I’m also working on.
Can you perhaps make the ACF function ‘Global’ as per something similar here:-
Not sure if this is also similar:-
The acf object is global. There is not need to assume otherwise.
The issue really is that a JS error on the page is ‘snowballing’ and causing the ‘acf is not defined’ error.
Can you please setup your website on a local install? I have a feeling that it is due to the long load times and the fact that you are clicking the button before the window.load event is triggered.
This is a script issue and there’s nothing wrong with the speed of the server that would influence loading in this way. This is the only error cross-sites that we get. Also please see developer comments from ThemePunch:-
I’ve also tested in the same manner and this bears out.
Thanks for the follow up. I’ve logged in again and taken another look.
It turns out your are most correct, and I have not fully understood your bug report.
It is only on CLICK of the image, that the error occurs. This is because your attachments contain ACF fields, at least 1 of which has conditional logic, but the edit slide page does not include the acf script.
I’m not sure how to fix this issue, as I can’t add in the acf script to this edit page… perhaps I will have to prevent the attachment fields from producing any JS.
Thanks for double-checking and I’m glad that you have now replicated the error.
Other than this issue it’s a really useful plugin that I’m using ongoing in a number of projects so hopefully you will be able to find a solution to this asap with a plugin update.
I noticed you fixed the error on the media library page. However, when using the plugin AdRotate Pro while having an extra field added to ‘attachments’ ACF still seems to output JS and causes the error:
Uncaught ReferenceError: acf is not defined
Is there any workaround or pointers that you could give me?
Thank you in advance,
The topic ‘Plugin Bug / Conflict in Media Library Selection’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2022 Advanced Custom Fields.