Browse Source

bugfix empty in clause in relation

Maurits van der Schee 9 years ago
parent
commit
ea2db453bb
1 changed files with 5 additions and 3 deletions
  1. 5
    3
      api.php

+ 5
- 3
api.php View File

@@ -1378,9 +1378,11 @@ class PHP_CRUD_API {
1378 1378
 				$first_row = true;
1379 1379
 				foreach ($select[$table] as $field => $path) {
1380 1380
 					$values = $collect[$path[0]][$path[1]];
1381
-					if (!isset($filters[$table])) $filters[$table] = array();
1382
-					if (!isset($filters[$table]['or'])) $filters[$table]['or'] = array();
1383
-					$filters[$table]['or'][] = array($field,'IN',$values);
1381
+					if ($values) {
1382
+						if (!isset($filters[$table])) $filters[$table] = array();
1383
+						if (!isset($filters[$table]['or'])) $filters[$table]['or'] = array();
1384
+						$filters[$table]['or'][] = array($field,'IN',$values);
1385
+					}
1384 1386
 					if ($first_row) $first_row = false;
1385 1387
 					else echo ',';
1386 1388
 					echo '"'.$field.'":"'.implode('.',$path).'"';

Loading…
Cancel
Save