$commands = [];
// Create a key for the loop prevention
- $key = $table . ':' . implode(':', array_keys($conditions)) . ':' . implode(':', $conditions);
+ $key = $table . ':' . json_encode($conditions);
// We quit when this key already exists in the callstack.
if (isset($callstack[$key])) {
$rel_def = array_values(self::$relation[$table])[0];
// Create a key for preventing double queries
- $qkey = $field . '-' . $table . ':' . implode(':', array_keys($conditions)) . ':' . implode(':', $conditions);
+ $qkey = $field . '-' . $table . ':' . json_encode($conditions);
// When the search field is the relation field, we don't need to fetch the rows
// This is useful when the leading record is already deleted in the frontend but the rest is done in the backend