Category archive – Notice: Trying to get property of non-object

Home Forums Calendar Products Events Calendar PRO Category archive – Notice: Trying to get property of non-object

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1361334
    Charles Simmons
    Participant

    Getting this error on category pages (none others, just event categories):

    Notice: Trying to get property of non-object in /wp-content/plugins/the-events-calendar/src/functions/template-tags/general.php on line 663
    data-title="Category Title" data-view="month" data-date="2017-10" data-baseurl="http://example.com/calendar/month/" data-default-mobile-view="month" data-default-view="month">
    #1362160
    Barry
    Member

    Hi Charles,

    Sorry to hear you’ve hit up against some problems.

    I can replicate this – but only for categories that do not or no longer exist. If that’s also the case for you then the best solution may be to set up redirects for any category pages that are no longer in use.

    Alternatively, if you have a live example of the problem you can point me to for an existing category I’d really love to take a closer look.

    Either way, there’s certainly a bug here and I’ll submit a report so that we can get it fixed 🙂

    #1362854
    Kevin
    Participant

    Hi Barry, we are having a similar issue. For us, the error message displays for categories with hyphens in the slug. Categories without hyphens do not display the error message. I also wanted to note that we can view the events despite the error message, and that all of the categories we’ve tested still exist. I’ve included our error message below:

    Notice: Trying to get property of non-object in XXX/wp-content/plugins/the-events-calendar/src/functions/template-tags/general.php on line 663
    data-title="Upcoming Events – XXX" data-startofweek="0" data-view="list" data-baseurl="http://XXX/events/list/" data-mobilebreak="782" data-default-mobile-view="list" data-default-view="list">

    Thanks for any guidance you can provide.

    #1362890
    Barry
    Member

    Hi Kevin,

    That’s a great note: in the short term, I’d recommend turning off the display of errors (which is generally a good idea on production websites).

    If all goes well we’ll have a fix for this available as soon as next week 🙂

    Thanks for your patience and support in the meantime!

    #1362897
    Charles Simmons
    Participant

    Hey Barry –

    I can confirm the same issue as Kevin. The category does exist and it has a hyphen in the slug. I can get rid of the error by setting debug to false, which I’ll do on production, but this was in a staging environment (I’d share a direct link, but I don’t want to expose the URL to all of the internets) and seemed like something that should be addressed.

    Let me know if you need anything else.

    #1362913
    Kevin
    Participant

    Barry,

    Thanks so much for your attention on this. I’ve hidden the error message in production using the method you provided. Please keep us updated on the fix.

    Best,
    Kevin

    #1362937
    Barry
    Member

    Definitely: I’ve attached the URL for this topic to the bug report so we can easily drop an update in here as soon as the fix ships 🙂

    #1372447
    Kevin
    Participant

    Hi Barry and Charles,

    I saw the following line in the release notes for the latest version of TEC (4.6.2):

    “Tweak – Avoid notice level errors when a non-existent category archive is requested (our thanks to Charles Simmons for highlighting this)”

    After updating the plugin, the error message has disappeared from my beta site. Thanks for your work on this.

    Best,
    Kevin

    #1372544
    Barry
    Member

    Happy to help and thank you for confirming that worked 🙂

    I’ll go ahead and close this topic however if we can assist with anything else, please don’t hesitate to create new topics as needed.

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Category archive – Notice: Trying to get property of non-object’ is closed to new replies.