{"id":19008680,"date":"2026-09-01T14:52:20","date_gmt":"2026-09-01T14:52:20","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/fatal-error-using-orm-with-object-caching\/"},"modified":"2026-09-01T14:52:20","modified_gmt":"2026-09-01T14:52:20","slug":"fatal-error-using-orm-with-object-caching","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/fatal-error-using-orm-with-object-caching\/","title":{"rendered":"Fatal error using ORM with Object Caching"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In the latest version, running a query like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tribe_events()-&gt;by( 'id', $post-&gt;ID )-&gt;first()-&gt;venues<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">results in a fatal error:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, no array or string given<br \/>#0 \/wp-content\/plugins\/the-events-calendar\/common\/src\/Tribe\/Utils\/Lazy_Collection.php(86): call_user_func<br \/>#1 \/wp-content\/plugins\/the-events-calendar\/common\/src\/Tribe\/Utils\/Lazy_Collection.php(86): Tribe\\Utils\\Lazy_Collection::resolve<br \/>#2 \/wp-content\/plugins\/the-events-calendar\/common\/src\/Tribe\/Utils\/Lazy_Collection.php(71): Tribe\\Utils\\Lazy_Collection::all<br \/>#3 \/wp-content\/plugins\/the-events-calendar\/common\/src\/Tribe\/Utils\/Collection_Trait.php(125): Tribe\\Utils\\Lazy_Collection::valid<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Disabling object caching resolves it. The workaround is to fetch venue and organizer IDs using <code>tec_get_venue_ids<\/code>, <code>tec_get_venue_id<\/code> or directly via <code>get_post_meta( $post_id, '_EventVenueID' );<\/code> but ideally using the ORM as before wouldn&#8217;t cause a fatal error.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If any other details are needed, let me know. Thanks!<\/p>\n","protected":false},"template":"","class_list":["post-19008680","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19008680","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19008680\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=19008680"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}