Property type String parses ' ' if left empty


(Jakob NIMIUS) #1

Hello

We are having a weird problem in several of our Neos instances where a NodeType property of the type
String saves a non-breaking space, if it is left empty in the BE.

The property definition in my NodeType yaml:

properties:
  text:
      type: string
      defaultValue: 'Text'
      ui:
        inlineEditable: true

In the template I render the property like so:
{neos:contentElement.editable(property: 'text', class: 'c-grid-teaser__text', tag: 'p')}

If the field is left empty (or the default text is removed), the frontend renders this:
<p class="c-grid-teaser__text">&nbsp;</p>

This makes it impossible to only render the block if it is filled with a condition like the following:

<f:if condition="{text}">
    {neos:contentElement.editable(property: 'text', class: 'c-grid-teaser__text', tag: 'p')}
</f:if>

Our current workaround looks like this:
<f:if condition="{text} && {text} != '&nbsp;'">

Since the same thing works in an older project with neos 3.3 this must have happened between that version and the neos 4.1 we use in the current projects.

Any help would be appreciated!


(Peter Rauber) #2

Hi Jakob

You are experiencing the impact of this bug: https://github.com/neos/neos-ui/issues/2284

Right now, I also work with a workaround like you do (in fusion as I dont use fluid anymore).

Best regards,
Peter


(Jakob NIMIUS) #3

Thank you for the info! In that case we will just wait for the update.