From 78aca62aa58047301accfda4012149b9b58f8028 Mon Sep 17 00:00:00 2001 From: Elizabeth Dunphy Date: Thu, 25 Jul 2019 08:37:13 +0200 Subject: [PATCH] [BUGFIX][PRS-285] adjust form wrapper depending on content to avoid errors --- Resources/Private/Fusion/Content/Form.fusion | 24 ++++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/Resources/Private/Fusion/Content/Form.fusion b/Resources/Private/Fusion/Content/Form.fusion index e3385cd..bd78f7d 100644 --- a/Resources/Private/Fusion/Content/Form.fusion +++ b/Resources/Private/Fusion/Content/Form.fusion @@ -29,17 +29,31 @@ prototype(Onedrop.Form.Hubspot:Content.Form) < prototype(Neos.Neos:ContentCompon action = 'submit' format = 'html' } + id = ${q(node).property('formIdentifier')} } content = Onedrop.Form.Hubspot:FormRuntimeFactory { identifier = ${q(node).property('formIdentifier')} } - renderer = afx` -
- {props.content} -
- ` + renderer = Neos.Fusion:Tag { + tagName = 'div' + + attributes { + data-ajax = ${props.formWrapperAttributes.data-ajax} + data-ajax.@if.hasForm = ${_hasForm} + data-ajax-uri = ${props.formWrapperAttributes.data-ajax-uri} + data-ajax-uri.@if.hasForm = ${_hasForm} + id = ${props.formWrapperAttributes.id} + id.@if.hasNoForm = ${!_hasForm} + } + + content = ${props.content} + + @context { + _hasForm = ${String.indexOf(props.content, '= 0} + } + } @cache { mode = 'uncached'