Home › Forums › Calendar Products › Events Calendar PRO › Fatal Error after upgrading to Events Calendar Pro 2.0.3 from 1.3.2
- This topic has 23 replies, 3 voices, and was last updated 13 years, 12 months ago by
Jonah.
-
AuthorPosts
-
April 10, 2012 at 5:57 am #17764
rudeetours
MemberHey all,
I’m hoping to get some help here. I’m working updating a site which was started by another developer and abandoned. (not my favorite kind of job, cleaning up after someone else’s messes, but nontheless it is what it is)
The site uses the events calendar on four different categories. One category, dolphin watching works here http://rudeetours.com/tours/dolphin-watching/. I upgraded to 2.0.3 to enable the reoccurring functionality. Now, the three other categories are not working. I receive a fatal error similar to the following on each of them.
Fatal error: Call to a member function get_event_taxonomy() on a non-object in /htdocs/www/wp-content/themes/impression/tpl_whale-watching.php on line 77
http://rudeetours.com/tours/sunset-cruise/
http://rudeetours.com/tours/creek-cruise/ and
http://rudeetours.com/tours/winter-wildlife/
I’ve looked at the templates for those pages and it’s bombing out in the same place where this code is found.
// in an events cat
if ( is_tax( $sp_ecp->get_event_taxonomy() ) ) {
$cat = get_term_by( 'slug', get_query_var('term'), $sp_ecp->get_event_taxonomy() );
$eventCat = (int) $cat->term_id;
$eventPosts = sp_get_events( array( 'eventCat' => $eventCat, 'time_order' => 'ASC' ) );
} // not in a cat
else {
$eventCat = 'Winter Wildlife';
$eventPosts = sp_get_events(array( 'eventCat' => $eventCat, 'time_order' => 'ASC' ));
}
Perhaps I’ve looked at this too long, but I’m not seeing the problem. Any insight or suggestions would be greatly appreciated.
April 10, 2012 at 10:10 am #17778Jonah
ParticipantHey rudeetours, it looks like the theme is still using old plugin code. In this particular case, I think it has to do with $sp_ecp not being defined as an object. I don’t think we use that as an object for events any longer. You’re going to need to re-code that portion and possibly other portions of the code with the appropriate code. Instead of $sp_ecp->get_event_taxonomy() you would use $tribe_ecp->get_event_taxonomy(). sp_get_events() is deprecated but we have a fall back in place so that should still work… Aside from that everything looks ok in the block of code you posted. But, like I said you might need to cleanup other template files too…
I hope that helps!
April 10, 2012 at 11:05 am #17786rudeetours
MemberThat makes sense. OK, this opens up a few new issues then. If sp_get_events() is OK, what about the following?
(‘Event List’, $sp_ecp->pluginDomain)
(‘Calendar’, $sp_ecp->pluginDomain)
global $sp_ecp;
list( $year, $month ) = split( ‘-‘, $sp_ecp->date );
$monthView = sp_sort_by_month( $eventPosts, $sp_ecp->date );
( $n = $startOfWeek; $n daysOfWeek)
strtolower($sp_ecp->daysOfWeek[$dayOfWeek])
…..
Then it also looks as though the developer who implemented this code copied it from a tutorial somewhere because there are comments like so/**
* Copy and paste this to events/table.php in your template to customize
*/global $sp_ecp;
// in an events cat
Are you aware any tutorials or documentation where this might have come from? If so, where are they and would they still be valid for the current version?
Thanks again for your quick response.April 10, 2012 at 11:09 am #17787Jonah
ParticipantWe don’t have any specific templating tutorials yet, just a lot of stuff sprinkled here and there and the documentation on template tags. This FAQ provides a good overview of the overriding principle: https://theeventscalendar.com/faq/what-are-template-overrides-and-how-do-i-do-them/
It sounds like you probably have a bunch of files in an ‘events’ folder in the theme that will need to be updated (because these don’t update when you update the plugin). You’ll want to go through each one and compare with the current base files described in the FAQ and migrate all the new code over.
April 10, 2012 at 11:18 am #17788rudeetours
MemberHmm. Wondering if it might be easier to start over from scratch.
Should I be able to enable the plugin, place some minor snippet on my page and WA LA, POOF, magically there’s my calendar?April 10, 2012 at 1:10 pm #17789rudeetours
MemberSo, what does it mean if there is no events directory within my theme directory?
April 10, 2012 at 8:41 pm #17799Jonah
ParticipantThe plugin should work out of the box and if you remove the ‘events’ folder in your theme, the plugin will just use it’s own built in templates instead of the templates overrides in that ‘events’ folder and should just work. You could temporarily rename the folder just to test it out.
It might be easiest to start from scratch and for any custom coded template overrides in the ‘events’ folder, just go through one by one and try to re-implement the custom code as best you can.
I hope that helps,
JonahApril 11, 2012 at 11:31 am #17821rudeetours
MemberJonah,
I’ve got three sites to fix. Here is the first one I’m working on. http://www.rudeeinletcharters.com/schedule-rates/
I’ve got my current month’s calendar up and re-styled. However, the navigation from month to month isn’t working as well as the buttons to upcoming events etc. What would be the current replacement for the following?
Also the dropdowns aren’t navigating to display.
Here’s what I’ve got.
Calendar
<a href=''>
←<a href=''>
→<a class='tec-button-off' href=''>pluginDomain)?>
<a class='tec-button-on' href=''>pluginDomain)?><a title="pluginDomain) ?>" class="ical" href="">pluginDomain) ?>
April 11, 2012 at 11:33 am #17822rudeetours
MemberHmm, well that didn’t work. I’ll try this.
Calendar
<a href='’>
←<a href='’>
→<a class='tec-button-off' href='’>pluginDomain)?>
<a class='tec-button-on' href='’>pluginDomain)?><a title="pluginDomain) ?>” class=”ical” href=””>pluginDomain) ?>
April 11, 2012 at 12:25 pm #17824rudeetours
MemberOK, found the current code snippets in gridview.php. This site is set up with a page template. So, I updated those code snippets, but the links (although they look right) don’t work.
Do you have any idea why http://www.rudeeinletcharters.com/events/upcoming
http://www.rudeeinletcharters.com/events/2012-05
http://www.rudeeinletcharters.com/events would not be valid url’s? I assume it is some customization that the previous developer made. I’m not sure where to look.April 11, 2012 at 4:02 pm #17830Jonah
ParticipantIf you look at the same files in the /wp-content/plugins/the-events-calendar/views – you’ll see what should be there. Those are the core template files that the plugin will use if you don’t have the same file in the ‘events’ folder.
As for the links not working, what do you have setup as your Events URL Slug in Settings > The Events Calendar? If it’s not ‘events’ then that would be why those links aren’t working. The slug should match up with the permalinks.
April 12, 2012 at 5:03 am #17847rudeetours
MemberEvents slug url: events
Single event url slug: event
So, to me that means that http://www.rudeeinletcharters.com/events/ and http://www.rudeeinletcharters.com/events/2012-05 should work right?
This page has the updated template to display the events. http://www.rudeeinletcharters.com/schedule-rates/
I’m using The events calendar pro 2.0.5 and the events calendar 2.0.5. As a note, before we upgraded to 2.0.5 to have the recurrence option those links did work with the events calendar pro 1.3.2.
Any ideas?April 12, 2012 at 2:41 pm #17863Jonah
ParticipantMy guess is there’s still some conflict, either theme or plugin that’s causing problems. I could take a quick look if you want to send me WP admin access to jonah [at] tri [dot] be
Is this a live site? I.e. is it ok for me to change anything? I’ll put it all back to normal when I’m done.
April 16, 2012 at 7:14 am #17934rudeetours
MemberJonah, Please look for my email. Thanks in advance for your help.
April 16, 2012 at 5:35 pm #17958Rob
MemberA heads up that Jonah is travelling through Wednesday, so he may not be as active on the forums as he normally would be. Wanted to set expectations accordingly in case you don’t receive a response until then.
-
AuthorPosts
- The topic ‘Fatal Error after upgrading to Events Calendar Pro 2.0.3 from 1.3.2’ is closed to new replies.
