From 131506d74e6c6f4d74ae3b09630d9cc8098ebd8b Mon Sep 17 00:00:00 2001 From: Luca Haid Date: Mon, 10 Feb 2025 08:04:04 +0000 Subject: [PATCH] Update TTCrud.php --- lib/TTCrud/TTCrud.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/TTCrud/TTCrud.php b/lib/TTCrud/TTCrud.php index a79537acb..7c963e1c3 100644 --- a/lib/TTCrud/TTCrud.php +++ b/lib/TTCrud/TTCrud.php @@ -89,7 +89,11 @@ class TTCrud extends mfBaseController { } $column = array_search('createBy', array_column($this->columns, 'key')); - if ($column !== false) { + if ($column !== false && + isset($this->columns[$column]['modal']['items']) && + is_array($this->columns[$column]['modal']['items']) && + count($this->columns[$column]['modal']['items']) > 0 + ) { $this->columns[$column]['modal']['items'] = array_map(function ($user) { return ['value' => intval($user->id), 'text' => $user->name]; }, UserModel::search(['employee' => true]));