]> _ Git - cubist_cms-back.git/commitdiff
wait #7209 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 25 Nov 2024 12:49:19 +0000 (13:49 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 25 Nov 2024 12:49:19 +0000 (13:49 +0100)
src/app/CubistCrudPanel.php

index c8b8aedf8be2ce39dcdc71a2c0641e5c27c26fa9..18acfbfd4518cefdbe933e523bb726e15bbf2942 100644 (file)
@@ -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;