From 1787c646e288dc4000a9e1878c46bb0633efb009 Mon Sep 17 00:00:00 2001 From: Lukas Bableck <42083846+lukasbableck@users.noreply.github.com> Date: Thu, 29 Feb 2024 16:29:18 +0100 Subject: [PATCH] Fix #167 bug with custom headline inputUnit field (#168) --- src/Element/CustomElement.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Element/CustomElement.php b/src/Element/CustomElement.php index 5c917b2..a7c332b 100644 --- a/src/Element/CustomElement.php +++ b/src/Element/CustomElement.php @@ -297,6 +297,13 @@ private function addFragmentControllerDefaults() $this->Template->element_html_id ??= $this->Template->cssID[0] ?? null; $this->Template->element_css_classes ??= $this->Template->cssID[1] ?? ''; + if ( + (!\is_string($this->Template->headline) && $this->Template->headline !== null) + || (!\is_string($this->Template->hl) && $this->Template->hl !== null) + ) { + return; + } + // Legacy templates access the text using `$this->headline`, twig templates use `headline.text` $this->Template->headline = new class($this->Template->headline, $this->Template->hl) implements \Stringable {