From 5b8d61b55b49ccc84d6005eb503c0c4f5a417b52 Mon Sep 17 00:00:00 2001 From: zemiacsik Date: Mon, 13 Mar 2023 13:51:48 +0100 Subject: [PATCH 1/2] FIX property_exists() parameters mixup property_exists() has first parameter "object_or_class" and second is a property to check --- src/ORM/ArrayList.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ORM/ArrayList.php b/src/ORM/ArrayList.php index 83e448b93..8483c50c2 100644 --- a/src/ORM/ArrayList.php +++ b/src/ORM/ArrayList.php @@ -604,7 +604,7 @@ class ArrayList extends ViewableData implements SS_List, Filterable, Sortable, L $firstRecord = $this->first(); - return is_array($firstRecord) ? array_key_exists($by, $firstRecord) : property_exists($by, $firstRecord ?? ''); + return is_array($firstRecord) ? array_key_exists($by, $firstRecord) : property_exists($firstRecord ?? '', $by); } /** From d60af9d16e4a118b6fdca5d601e2b163ca186979 Mon Sep 17 00:00:00 2001 From: zemiacsik Date: Tue, 14 Mar 2023 08:42:22 +0100 Subject: [PATCH 2/2] FIX property_exists() parameters mixup ensure that property parameter is a string --- src/ORM/ArrayList.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ORM/ArrayList.php b/src/ORM/ArrayList.php index 8483c50c2..c5c478326 100644 --- a/src/ORM/ArrayList.php +++ b/src/ORM/ArrayList.php @@ -604,7 +604,7 @@ class ArrayList extends ViewableData implements SS_List, Filterable, Sortable, L $firstRecord = $this->first(); - return is_array($firstRecord) ? array_key_exists($by, $firstRecord) : property_exists($firstRecord ?? '', $by); + return is_array($firstRecord) ? array_key_exists($by, $firstRecord) : property_exists($firstRecord, $by ?? ''); } /**