From a0f9aef5f53688ffcb8c9181d9d87307e7013571 Mon Sep 17 00:00:00 2001 From: argiepiano Date: Wed, 11 Feb 2026 22:43:49 -0700 Subject: [PATCH] Issue #160. Check if the conditions key exists. Fixes #160 --- og.module | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/og.module b/og.module index f9c82cb0..fea8e583 100644 --- a/og.module +++ b/og.module @@ -1472,9 +1472,11 @@ function og_query_og_membership_alter(QueryAlterableInterface $query) { foreach ($aliases as $alias => $field_name) { foreach ($tables as $key => $values) { - $condition = str_replace("$alias.entity_type", 'ogm.entity_type', $values['condition']); - $condition = str_replace("$alias.entity_id", 'ogm.etid', $condition); - $tables[$key]['condition'] = $condition; + if (!empty($values['condition'])) { + $condition = str_replace("$alias.entity_type", 'ogm.entity_type', $values['condition']); + $condition = str_replace("$alias.entity_id", 'ogm.etid', $condition); + $tables[$key]['condition'] = $condition; + } } }