From 4a45bb269be4463d893b14f7403e937248a2b85c Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Fri, 15 Nov 2024 14:02:54 +1300 Subject: [PATCH] FIX Avoid infinite recursive loop with attributes in schemadata --- src/Form/BlockLinkField.php | 16 ---------------- .../ElementalBannerBlock/Form/BlockLinkField.ss | 2 +- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/Form/BlockLinkField.php b/src/Form/BlockLinkField.php index 580a300..db77f63 100644 --- a/src/Form/BlockLinkField.php +++ b/src/Form/BlockLinkField.php @@ -134,22 +134,6 @@ public function getShowLinkText() return $this->showLinkText; } - /** - * When not used in a React form factory context, this adds the schema and state data to SilverStripe - * template rendered attributes lists - * - * @return array - */ - public function getAttributes() - { - $attributes = parent::getAttributes(); - - $attributes['data-schema'] = json_encode($this->getSchemaData()); - $attributes['data-state'] = json_encode($this->getSchemaState()); - - return $attributes; - } - /** * Add some extra props for the React component to work with * diff --git a/templates/SilverStripe/ElementalBannerBlock/Form/BlockLinkField.ss b/templates/SilverStripe/ElementalBannerBlock/Form/BlockLinkField.ss index 80e4223..a1984dd 100644 --- a/templates/SilverStripe/ElementalBannerBlock/Form/BlockLinkField.ss +++ b/templates/SilverStripe/ElementalBannerBlock/Form/BlockLinkField.ss @@ -1,3 +1,3 @@ -
+
<%-- Rendered by the BlockLinkField React component --%>