Home › Forums › Calendar Products › Community Events › Javascript Errors on Add Event Page Only
- This topic has 10 replies, 2 voices, and was last updated 10 years, 1 month ago by Barry.
-
AuthorPosts
-
February 25, 2014 at 10:44 am #109190andreafphParticipant
Running into some errors after activation Events Calendar Pro + Community Events.
“TypeError: $(…).live is not a function
$(‘.ui-dialog-titlebar .ui-dialog-titlebar-close’).live(‘click’, function() {”
Line 73: events-calendar-pro/resources/events-admin.js?ver=3.4February 25, 2014 at 3:40 pm #109388BarryMemberHi!
It looks like your theme or possibly another plugin is replacing the version of the jQuery library (which is a set of code WordPress and many plugins like our own requires) with a different version being pulled in from Google:
<script type='<a>text/javascript</a>' src='<a href="view-source:http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js?ver=3.8.1">http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js?ver=3.8.1</a>'></script>
Based on the troubleshooting steps you indicated having completed so far my guess would be your theme is responsible for this: can you investigate removing this so that WordPress’s own (and more recent) version of the library is used? I suspect that will solve this.
Let us know how you get on!
February 25, 2014 at 6:27 pm #109488andreafphParticipantThe theme relies on the google.js– removing it breaks the site. It seems that only the community form/add page has a conflict with an essential plugin that I can resolve if I knew how to designate a different template to the form page only, so that I could disable the plugin on that one page. I have a custom default template for the event pages and it works well. How can I add a custom default template for the add/form page? I will attempt to try this solution, but what folder/directory do create this in?
February 25, 2014 at 6:34 pm #109491andreafphParticipantSorry, to clarify, I would like to know how to direct the form/add event page to a different template than the regular events template I have set in the dashboard/settings.
February 25, 2014 at 7:40 pm #109517andreafphParticipantLastly, if I deactivate pro and just keep community and standard events cal plugins, there are no errors.
February 25, 2014 at 8:00 pm #109520andreafphParticipantOkay so I kept coming across solutions that said that .live is deprecated and to use .on instead. I updated this in the event-admin.js file and everything is working. HOWEVER, I would still like to know how to switch to a different template for both ‘add’ page and ‘edit event’ page so I can use a full width template, rather than one w/ sidebars (which is fine for the list view pages, etc.) I can start a new topic if necessary.
February 26, 2014 at 3:40 pm #109887BarryMemberHi!
You can specify a different template with a filter. To use the default page template for instance (but only for Community Events views) you could do:
add_filter( 'tribe_events_community_template', 'comm_events_tpl' ); function comm_events_tpl() { return 'page.php'; }
Does that help?
February 26, 2014 at 4:39 pm #109990andreafphParticipantGetting closer…I’ve been working out some kinks in the backend…is there any way to specifically target a: the form only, and b: the edit page ‘My Events’ ?
*Also, I’m not seeing the line w/ ‘Not an evil spammer’ nor the checkbox. I’ve found someone’s site who is showing this and am rummaging around the code to see why it’s not showing in my view (while logged out, and anonymous submissions are being accepted in settings)
February 27, 2014 at 1:34 pm #110318BarryMemberYou should be able to differentiate, yes – check out the list of available functions, there are some useful template tags like tribe_is_community_edit_event_page():
We do try to stick to one issue per thread – it helps us to stay focused on solving the problem at hand and also to ensure fair service for all our users – so for any other topics such as help with the anti-spam control please create a fresh thread – thanks!
February 27, 2014 at 9:15 pm #110690andreafphParticipantThank you for this. I’ll need a little more guidance on directing the ‘my events’ page to another template- I’ve tried in my functions.php:
add_filter( ‘tribe_is_community_my_events_page’, ‘comm_events_tpl’ );
function comm_events_tpl() { return ‘single-fullwidth.php’; }But I get an error that I ‘Cannot redeclare tribe_is_community_my_events_page()’ as it’s already called from tribe-community-events-template-tags.php
And in tribe-community-events-template-tags.php I’ve also tried:
function tribe_is_community_my_events_page() {
$tce = TribeCommunityEvents::instance();return ‘single-fullwidth.php’;
}And:
function tribe_is_community_my_events_page() { return ‘single-fullwidth.php’; }The single-wp_router_page class is still being applied to the body and the selected template from settings is still being grabbed.
Please take your time in getting back to me. This is no longer as urgent as I was able to make some modifications so the front end is good to go and for now I will be the only one seeing the ‘My Events’ page. So close! This plugin is very much worth the $ and effort to get it going full steam. Thanks!
February 28, 2014 at 6:41 am #110766BarryMemberOK, so it sounds like you’re getting close and just have a few wrinkles to iron out here.
add_filter( ‘tribe_is_community_my_events_page’, ‘comm_events_tpl’ ); function comm_events_tpl() { return ‘single-fullwidth.php’; }
Please note that tribe_is_community_my_events_page() is a function rather than a filter or hook name and so can’t really be used successfully in this form.
But I get an error that I ‘Cannot redeclare tribe_is_community_my_events_page()’ as it’s already called from tribe-community-events-template-tags.php
Right, so in your second snippet it seems you tried to define your own function, also named tribe_is_community_my_events_page and that will certainly cause an issue – in PHP, you may not define two functions of the same name.
It’s fantastic that you’re digging into this and are making headway but, I think, realistically you’re going to need a little more support on the coding side than we can really provide here. I hope you understand our position on that one and that you persevere further, I’m sure you’ll get there 🙂
Good luck!
-
AuthorPosts
- The topic ‘Javascript Errors on Add Event Page Only’ is closed to new replies.