Hi, I have exactly the same problem with the list view. Same set up: WP 6.1.1 and PHP 7.4. The calendar view works fine.
Best,
Thorsten
Thread Starter
wjh
(@wjh)
Thanks @hyperbrand.
FYI just updated to EM 6.1.5; unfortunately this error notice still shows for event lists.
Maybe it will be fixed with the next release? One can only hope 🙂
[01-Dec-2022 18:34:34 UTC] PHP Notice: Trying to get property 'post_type' of non-object in /wp-content/plugins/events-manager/classes/em-event-post.php on line 111
[01-Dec-2022 18:34:36 UTC] PHP Notice: Die Funktion WP_Object_Cache::get wurde <strong>fehlerhaft</strong> aufgerufen. Der Cache-Schlüssel muss eine Ganzzahl oder eine nicht leere Zeichenfolge sein, NULL ist der vorgegebene Typ. Weitere Informationen: <a href="https://wordpress.org/support/article/debugging-in-wordpress/">Debugging in WordPress (engl.)</a>. (Diese Meldung wurde in Version 6.1.0 hinzugefügt.) in /wp-includes/functions.php on line 5835
[01-Dec-2022 18:34:36 UTC] PHP Notice: Die Funktion WP_Object_Cache::set wurde <strong>fehlerhaft</strong> aufgerufen. Der Cache-Schlüssel muss eine Ganzzahl oder eine nicht leere Zeichenfolge sein, NULL ist der vorgegebene Typ. Weitere Informationen: <a href="https://wordpress.org/support/article/debugging-in-wordpress/">Debugging in WordPress (engl.)</a>. (Diese Meldung wurde in Version 6.1.0 hinzugefügt.) in /wp-includes/functions.php on line 5835
Thread Starter
wjh
(@wjh)
FYI just updated to EM 6.1.6; unfortunately this error notice still shows for event lists.
Any plans on fixing this soon?
Cheers
For what it’s worth I don’t see this message when logged into my site. Only if I’m a public/guest accessing the site.
I was experiencing the same thing and I believe I have found the culprit.
The notice is pretty clear whats happening (though it does a poor job saying where it happened) and so I searched the plugin code for instances of wp_cache_get
and wp_cache_set
. I then looked at what values were being passed as the key.
Low and behold, in em-taxonomy-term.php
on line 118, inside of a function named get_color()
, wp_cache_get
and wp_cache_set
are utilized with the term_id
as the key if color is not set. This was the problem for me as some of my events had no category and thus no term_id
!
In em-taxonomy-term.php
I added an additional check for get_color()
:
if( empty($this->color) && !empty($this->term_id))
This cleared up the notices for me, though I bet that just ensuring all events had a category would also do the trick. I hope this helps!
-
This reply was modified 2 years, 1 month ago by
jayharland.