From 6bc5668333e15b36943df6b63fb5fbfdeae4836b Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 25 Nov 2024 12:29:44 +0100 Subject: [PATCH] wait #7208 @0:05 --- src/app/CubistCrudPanel.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/app/CubistCrudPanel.php b/src/app/CubistCrudPanel.php index 9b99c56..c8b8aed 100644 --- a/src/app/CubistCrudPanel.php +++ b/src/app/CubistCrudPanel.php @@ -157,6 +157,20 @@ class CubistCrudPanel extends CrudPanel $this->modifyField($name, ['default' => $value, 'value' => $value]); } + public function fields() + { + $res = $this->overwriteFieldNamesFromDotNotationToArray($this->getOperationSetting('fields') ?? []); + if (is_bool($this->getCurrentEntry())) { + return $res; + } + foreach ($res as $k => $v) { + if (isset($v['hint'])) { + $res[$k]['hint'] = str_replace('$id', $this->getCurrentEntry()->id, $v['hint']); + } + } + return $res; + } + public function getEntryOrModel() { if (null === $this->entry) { -- 2.39.5