From 77f6f679d238eed26a4e5883ec7a5ef4b3bb325b Mon Sep 17 00:00:00 2001 From: Dario Rekowski on RockPI Date: Thu, 13 May 2021 10:50:07 +0000 Subject: [PATCH] fix function to work also with empty table --- community_server/src/Model/Table/TransactionsTable.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/community_server/src/Model/Table/TransactionsTable.php b/community_server/src/Model/Table/TransactionsTable.php index 742ce7882..f2bf1437f 100644 --- a/community_server/src/Model/Table/TransactionsTable.php +++ b/community_server/src/Model/Table/TransactionsTable.php @@ -426,6 +426,9 @@ class TransactionsTable extends Table } } } + if(count($state_user_ids) < 1) { + return ['success' => true]; + } //var_dump($entities); $stateUsersTable = TableRegistry::getTableLocator()->get('StateUsers'); $existingStateUsers = $stateUsersTable->find('all')->select(['id'])->where(['id IN' => $state_user_ids])->order(['id'])->all();