• Resolved konus77

    (@konus77)


    After installing give, the search of my pixabay plugin https://wordpress.org/plugins/pixabay-images/ stops working. In the console I found the follwoing errors:

    Uncaught TypeError: $ is not a function			media-upload.php?post_id=1990&tab=pixabaytab:277
    	(anonymous function) 	@	media-upload.php?post_id=1990&tab=pixabaytab:277
    
    Uncaught TypeError: $ is not a function			media-upload.php?post_id=1990&tab=pixabaytab:283
    	(anonymous function)	@	media-upload.php?post_id=1990&tab=pixabaytab:283
    	m.event.dispatch	@	load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,plupload,plupload-handlers&ver=4.3.1:4
    	r.handle		@	load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,plupload,plupload-handlers&ver=4.3.1:4

    The search is handled with an ajax call. How can I help to solve this problem?

    https://wordpress.org/plugins/give/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Matt Cromwell

    (@webdevmattcrom)

    Hi there,

    I was able to reproduce that error with Pixabay and Give locally, but I can’t say exactly why Give would trigger that error. But to me it seems to be a problem with Pixabay that the jQuery variable is not getting passed into the function properly. Basically, when I swap out the relevant “$” with “jQuery” it works as expected without any errors. Here’s the updated file I used:

    https://gist.github.com/mathetos/e55282b977d9ee11d184

    Probably worth giving the Pixabay authors a heads up on. I believe they can strengthen their javascript a bit to avoid this problem. But this is the first I’ve seen with Give so we’ll keep a close eye on this for other conflicts to see if there’s anything we can do on our end. The thing is that Give doesn’t do that with other plugins that trigger a modal in the editor (like EDD or CalderaForms) and Pixabay doesn’t have this problem with EDD or CalderaForms either.

    Let me know if the Pixabay guys have insight on their end, but that “hack” will get you resolved for now (though it’s far less than ideal).

    Thread Starter konus77

    (@konus77)

    Thank you for your fast help! I will post a link of your answer in the pixabay thread. I keep you posted if I get a update there.
    Greetings Konus

    I just looked into this. $ is typically used as jQuery shortcut function. However, $ is also used for PHP variables that are directly embedded into strings. I cannot reproduce the error, but here’s a wild guess: Maybe under some circumstances, the var $=jQuery gets mixed up by PHP.

    After being aware of the $ ambiguity, I wouldn’t recommend or use this shortcut name for jQuery in the future.

    Plugin Contributor Devin Walker

    (@dlocc)

    I’ve never heard of jQuery’s $ symbol being mixed up with PHP before. As well, we user jQuery in noconflict mode with Give so this shouldn’t be an issue. If it is, and you can give me a way to reproduce the bug I can fix it.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘possibly conflict with pixabay plugin’ is closed to new replies.