Fatal Error after upgrading to Events Calendar Pro 2.0.3 from 1.3.2

Home Forums Calendar Products Events Calendar PRO Fatal Error after upgrading to Events Calendar Pro 2.0.3 from 1.3.2

Viewing 15 posts - 1 through 15 (of 24 total)
  • Author
    Posts
  • #17764
    rudeetours
    Member

    Hey 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.

    #17778
    Jonah
    Participant

    Hey 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!

    #17786
    rudeetours
    Member

    That 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.

    #17787
    Jonah
    Participant

    We 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.

    #17788
    rudeetours
    Member

    Hmm. 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?

    #17789
    rudeetours
    Member

    So, what does it mean if there is no events directory within my theme directory?

    #17799
    Jonah
    Participant

    The 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,
    Jonah

    #17821
    rudeetours
    Member

    Jonah,
    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) ?>


    #17822
    rudeetours
    Member

    Hmm, 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) ?>

    #17824
    rudeetours
    Member

    OK, 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.

    #17830
    Jonah
    Participant

    If 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.

    #17847
    rudeetours
    Member

    Events 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?

    #17863
    Jonah
    Participant

    My 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.

    #17934
    rudeetours
    Member

    Jonah, Please look for my email. Thanks in advance for your help.

    #17958
    Rob
    Member

    A 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.

Viewing 15 posts - 1 through 15 (of 24 total)
  • The topic ‘Fatal Error after upgrading to Events Calendar Pro 2.0.3 from 1.3.2’ is closed to new replies.