Posted: September 14, 2015 at 7:58 am
|
Hello – I am experiencing a jQuery conflict between the Calendar Widget and my theme (Royal by 8Theme). It is not allowing the Calendar Widget Tooltip to display. I would appreciate any assistance that you can provide to correct this as it is the last thing I need to fix to take my site live. One example of this is – http://0ae.f46.myftpupload.com/classes/aug-oct-high-ice-htr/ Thank you, |
September 14, 2015 at 10:10 am Hi Kirstin, I checked and it looks like the error is Uncaught TypeError: Cannot read property ‘call’ of undefined from the /wp-content/themes/coffeescripts/jquery.nanoscroller.coffee file. Can you try temporarily de-queueing the above script to for the pages that have the calendar widget to see if that helps? |
|
|
Josh, Could you explain how to do that? Thanks, |
|
Josh, I don’t see that file in my wp-content folder. |
Hi Kirstin, It may help if you can contact the theme author for support on how to remove or fix the theme’s scripts. Here’s a screenshot of the information I gathered from viewing the web inspector where it shows the source of the error: |
|
|
Josh, As I mentioned that folder “coffeescripts” does not exist on my server. Is it possible it did not load when I installed Event Espresso? |
|
In addition, this is not a theme issue. I have seen other users with jQuery conflicts on the forums and EE has assisted them in resolving them. I truly appreciate your help if you can provide a solution. |
|
Hi Kirstin. I’ve looked at your site, and the issue seems to be related to the etheme.js file (http://0ae.f46.myftpupload.com/wp-content/themes/royal/js/etheme.js). The offending code seems to be a typo on line 202
The first apostrophe is a “fancy” apostrophe rather than a basic one, and these can cause code breakages. 2 options: 1) Edit the file and change the apostrophe The second option may take slightly longer, but it is the better option. Fixing the code issue *should* fix the calendar unless there are further errors currently not visible due to this one, impossible to tell until this one is fixed. |
Hi Kirstin, The jQuery conflicts we help with on the forums are generally down to some JavaScript not being loaded in no_conflict() mode or .js files that aren’t needed on the page are being loaded and we can remove those from the EE pages, this issue is different from that. This issue is likely to be a theme issue, if you temporarily switch to one do the default themes such as twentyfourteen and revisit your event page, do the tooltips work? Currently your themes etheme.js file is throwing a Syntax error, preventing any other JavaScript from running on the page, looking at the source of that file – http://take.ms/1gZgu Notice the styled ‘ within the code, that needs to be fixed but may not actually be the cause of the problem, but that would be the first step I would take. |
|
|
Dean and Tony – thanks for your replies. Unfortunately correcting the etheme.js file did not solve the problem. Any other suggestions? I appreciate your help. |
|
September 16, 2015 at 10:01 am I believe it may have to do with the missing theme/coffeescripts folder. It is failing to load this resource – [Error] Failed to load resource: the server responded with a status of 404 (Not Found) (jquery.nanoscroller.coffee, line 0) |
September 16, 2015 at 10:47 am Hi Kirstin, Can you check to see if the WordPress theme (or another plugin) is trying to load the nanoscroller coffee script? I think that’s something that the Royal theme adds, Event Espresso doesn’t use jQuery.nanoscroller. |
|
|
Further information on error – |
I think the way forward here is to find out if it’s the current WordPress theme (Royal) or another plugin that’s causing the error. Once you find that, we’ll know where to go next. |
|
|
Josh, the theme author has not been much help. They just said it is the plugin causing the error. I don’t believe it is an error caused by the theme because when I change the homepage to include a sidebar the tooltips display correctly. This is the only page it occurs correctly on. I did try disabling all the other plugins and the error still occurs so I am inclined to say it is being caused by EE.I appreciate any further ideas you have on how to correct it. |
If you make a temporary change to the site to use another theme does the error still occur? |
|
|
Josh, you are correct, when I change to generic 2013 theme the tooltips display correctly. Is there any way to determine why my theme is conflicting? My theme author has been totally unhelpful. |
September 18, 2015 at 10:57 am Hi Kirstin, Usually what it comes down to is not all jQuery plugins should all load on the same page, because they can conflict with each other. What I’ll typically do in this situation is go into the theme and look for the function where all the JavaScript files are enqueued. Then, one by one comment out each jQuery plugin if it’s loaded via a separate file. In this particular case, it appears the theme author has chosen to bundle a lot of the plugins into one file, plugins.js, and it even appears that it might be generated by coffeescript? It’d help to know if plugins.js is actually a file in the theme, or if it’s a file that gets generated on the fly. One possible solution is if plugins.js is actually a file that can be dequeued, you dequeue it for any of the pages that have the calendar widget. There’s some general information about how to disable specific scripts in this article: http://justintadlock.com/archives/2009/08/06/how-to-disable-scripts-and-styles |
|
|
Josh, The plugins.js is a separate file included with the theme. I have uploaded it here for you to look at. https://app.box.com/s/fzkvkwxxsv1l44xslbz3zab9j4oz6asc Thanks again, Kirstin |
|
September 19, 2015 at 10:32 am Also, I believe this is the file where the plugins.js is being enqeued. It appears the ‘handle’ is ‘plugins’. https://app.box.com/s/qmx0bev6ymzsxxecnud58ps7dmhz9lii I tried adding the following lines of code to my functions.php file and it did not work. add_action( ‘wp_print_scripts’, ‘my_deregister_javascript’, 100 ); function my_deregister_javascript() { |
Is it “did not work” as in the script still loads -or- it is no longer loading, but the same JavaScript error still occurs? If it’s still loading, you could try adding this to the end of the same file:
|
|
|
Josh, Sorry I should have been more clear. The same Javascript error is returned. When I add your additional lines of text I now receive 404 page not found errors for all pages which contained the calendar sidebar widget. |
|
To be more specific – I receive a 404 error for all Event pages. |
While the code I posted had an error, that I’ve fixed, it should not have resulted in a 404 error. So is there another script from the theme that appears to be causing the error since it appears that it’s not plugins.js? |
|
|
Josh, I updated permalink and the 404 error was corrected. But the code still did not fix the tooltip. |
|
One other idea – Dean had given me the following code to get the tooltips to appear on the Calendar page. Is it possible to use a similar code on the event pages where I use the Calendar widget? //Disable the Royal themes plugin.js if the post/page has the ESPRESSO_CALENDAR shortcode. |
Yeah if it helps with the main calendar, the same code should also help with the calendar widget. So you could try adding a check for the widget in the above conditional like this:
|
|
|
September 21, 2015 at 10:09 am Josh, I just want to clarify, the pages where the widget tooltips are not working correctly do not contain the shortcake for ESPRESSO_CALENDAR. They are the actual event pages. Would the code still be the same as above? And where is the code added within that string? Thank you!!! |
September 21, 2015 at 10:57 am The |
|
|
Josh, by including the additional code it actually stopped the tooltip from working on the calendar page too. Please let me know if I did something wrong. This is what the code looks like in my function.php file – //Disable the Royal themes plugin.js if the post/page has the ESPRESSO_CALENDAR shortcode. |
|
Furthermore it returned this error when updating the file – Parse error: syntax error, unexpected ‘||’ (T_BOOLEAN_OR) in /home/content/p3pnexwpnas04_data02/48/2385748/html/wp-content/plugins/SiteSpecificCustomFunctions/SiteSpecificCustomFunctions.php on line 18 |
|
And Not to add insult to injury, but when I removed the revised code and returned it to the original that Dean provided, the tooltips are no longer working on the calendar page either. |
Hi Kirstin, Have you verified that if the plugins.php JavaScript doesn’t load on the page, that the tooltips actually work as expected? Your conditional where it checks whether to dequeue the script is:
You can also remove the conditional entirely to see if removing the script works as expected. When you remove the conditional, your code will look like this:
|
|
|
Josh, when I take out the conditional it doesn’t display the calendar widget at all. It also disables several other things (i.e. google maps). Of great concern is when I returned the site specific functions file to the one Dean originally gave me it is no longer working for the tooltips on the Calendar page. |
|
Josh, I was able to fix the tooltips on the calendar page (when copying code it changed plain apostrophe to fancy apostrophe). However, the tooltip on the widget still isn’t working. If you have any other suggestions I am desperate. |
September 22, 2015 at 10:52 am If you completely remove plugins.js from loading on all pages, does the tooltip on the widget work? |
|
|
Josh, if I remove plugins.js from loading on all pages the calendar widget doesn’t even display so it is impossible to tell. |
So instead of removing the entire file (which is likely causing new JavaScript errors), can you try commenting out each individual plugin within plugins.js? This way you’ll be narrowing down which script within the plugins.js file may be causing the error. For example, if you open up plugins.js you’ll see there is jQuery Easing, jQuery Cookie, Magnificent popup, the Isotope jQuery plugin, jQuery Waypoints, and so on. You can comment out each section individually, one at a time, then test the page with the calendar widget. |
|
|
Josh, I went through and commented out each individual section of script in plugins.js and the tooltips still do not work. Please look at the error again that is shown in this screen grab https://app.box.com/s/cuq92w7oqnr1atplgwqh9jylcf1ducwu It appears it is a conflict with http://0ae.f46.myftpupload.com/wp-content/plugins/event-espresso-core-reg/core/third_party_libs/qtip/jquery.qtip.js |
September 23, 2015 at 11:18 am That’s correct, the error message in the console suggests there’s a conflict between plugins.js line 285 and jquery.qtip.js. When you switch to a standard theme like twentytwelve or any other theme from the wordpress.org theme repository you’ll notice there is no conflict. Along with that, the qtip plugin that Event Espresso uses is also a jQuery plugin that’s available from here: In order to resolve any conflicts between jQuery plugins, oftentimes the solution is find the conflicting plugin, then remove the jQuery plugin and its dependant scripts from the pages where the conflict happens. |
|
|
Josh, The odd thing is, line 285 of plugins.js is blank. Can you provide any suggestions on how to remove the conflicting jQuery plugin other than what we have already tried? I am a bit desperate to resolve this issue so I can take this site live. |
Another method to troubleshoot the theme is start with no JavaScript at all from the theme (similar to using another theme). Then you restore one JavaScript file at a time, until you find breakage. |
|
The support post ‘jQuery Conflict Calendar Widget’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.