From f8bde0ce73872d1ddcc803d852130747a77bd337 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 25 Nov 2024 13:49:19 +0100 Subject: [PATCH] wait #7209 @0.5 --- src/app/CubistCrudPanel.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/app/CubistCrudPanel.php b/src/app/CubistCrudPanel.php index c8b8aed..18acfbf 100644 --- a/src/app/CubistCrudPanel.php +++ b/src/app/CubistCrudPanel.php @@ -160,12 +160,20 @@ class CubistCrudPanel extends CrudPanel public function fields() { $res = $this->overwriteFieldNamesFromDotNotationToArray($this->getOperationSetting('fields') ?? []); - if (is_bool($this->getCurrentEntry())) { + try { + $entry = $this->getCurrentEntry(); + if (is_bool($entry)) { + return $res; + } + } catch (\Exception $e) { + return $res; + } catch (\Error $e) { return $res; } + foreach ($res as $k => $v) { if (isset($v['hint'])) { - $res[$k]['hint'] = str_replace('$id', $this->getCurrentEntry()->id, $v['hint']); + $res[$k]['hint'] = str_replace('$id', $entry->id, $v['hint']); } } return $res; -- 2.39.5