Home › Forums › Calendar Products › Events Calendar PRO › Category archive – Notice: Trying to get property of non-object
- This topic has 9 replies, 3 voices, and was last updated 6 years, 5 months ago by Charles Simmons.
-
AuthorPosts
-
October 9, 2017 at 4:44 pm #1361334Charles SimmonsParticipant
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">
October 11, 2017 at 9:40 am #1362160BarryMemberHi 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 🙂
October 12, 2017 at 12:15 pm #1362854KevinParticipantHi 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.
October 12, 2017 at 1:42 pm #1362890BarryMemberHi 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!
October 12, 2017 at 1:50 pm #1362897Charles SimmonsParticipantHey 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.
October 12, 2017 at 2:23 pm #1362913KevinParticipantBarry,
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,
KevinOctober 12, 2017 at 3:01 pm #1362937BarryMemberDefinitely: 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 🙂
October 31, 2017 at 12:55 pm #1372447KevinParticipantHi 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,
KevinOctober 31, 2017 at 3:04 pm #1372544BarryMemberHappy 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.
-
AuthorPosts
- The topic ‘Category archive – Notice: Trying to get property of non-object’ is closed to new replies.