Bug #54572

Neos deletes text parts on saving data

Added by Alexander Schnitzler over 1 year ago. Updated 5 months ago.

Status:Closed Start date:2013-12-22
Priority:Should have Due date:
Assigned To:Dominique Feyer % Done:

0%

Category:-
Target version:Base Distribution - 1.x

Description

I am using the blog plugin of Robert Lemke which add's blog posts as new documents and comments als child nodes.

If a user posts a comment I can log into the backend and edit the comment inline as well as changing data via the inspector.

Depending on the text of the comment itself, parts of the text will be deleted on applying any change.

The comment text:

Hi alex,
thanks for this nice tutorial.
I found a small problem at the end of you article.
<f:translate key="error.{field.propertyName}.{field.errorCode}" ... This will only work if your property is lowercase only. If you use lower-camelcase like myTestProperty it won’t work because you will have to convert it to my_test_property. Did you have any solution for this?

Thanks
Alex

The comment text will be processed by htmlentities and nl2br which results in:

Hi alex&comma;<br />
&NewLine;thanks for this nice tutorial&period;<br />
&NewLine;I found a small problem at the end of you article&period;<br />
&NewLine;&lt;f&colon;translate key&equals;&quot;error&period;&lbrace;field&period;propertyName&rcub;&period;&lbrace;field&period;errorCode&rcub;&quot; &period;&period;&period; This will only work if your property is lowercase only&period; If you use lower-camelcase like myTestProperty it won&rsquo;t work because you will have to convert it to my&lowbar;test&lowbar;property&period; Did you have any solution for this&quest;<br />
&NewLine;<br />
&NewLine;Thanks<br />
&NewLine;Alex

So the whole comment data inside the node repository is this:

a:5:{s:6:"author";s:4:"Alex";s:12:"emailAddress";s:11:"mail@foo.de";s:4:"text";s:630:"Hi alex&comma;<br />
&NewLine;thanks for this nice tutorial&period;<br />
&NewLine;I found a small problem at the end of you article&period;<br />
&NewLine;&lt;f&colon;translate key&equals;&quot;error&period;&lbrace;field&period;propertyName&rcub;&period;&lbrace;field&period;errorCode&rcub;&quot; &period;&period;&period; This will only work if your property is lowercase only&period; If you use lower-camelcase like myTestProperty it won&rsquo;t work because you will have to convert it to my&lowbar;test&lowbar;property&period; Did you have any solution for this&quest;<br />
&NewLine;<br />
&NewLine;Thanks<br />
&NewLine;Alex";s:4:"spam";b:0;s:13:"datePublished";O:8:"DateTime":3:{s:4:"date";s:19:"2013-12-22 14:53:06";s:13:"timezone_type";i:3;s:8:"timezone";s:13:"Europe/Berlin";}}

When applying any change the text will be changed as such:

Hi alex,<br/>

thanks for this nice tutorial.<br/>

I found a small problem at the end of you article.<br/>

<br/>

Thanks<br/>

Alex

Data inside the node repository:

a:5:{s:6:"author";s:5:"Alex ";s:12:"emailAddress";s:11:"mail@foo.de";s:4:"text";s:135:"Hi alex,<br/>

thanks for this nice tutorial.<br/>

I found a small problem at the end of you article.<br/>

<br/>

Thanks<br/>

Alex";s:4:"spam";b:0;s:13:"datePublished";O:8:"DateTime":3:{s:4:"date";s:19:"2013-12-22 00:00:00";s:13:"timezone_type";i:3;s:8:"timezone";s:13:"Europe/Berlin";}}

Maybe someone can tell me how the data is process before it's saved inside the database to find out what's going on in detail there.

History

#1 Updated by Dominique Feyer 5 months ago

  • Status changed from New to Closed
  • Assigned To set to Dominique Feyer

Hi Alex,

So you post a comment with a Fluid viewhelper inside, right ?

Sounds logic that Neos process the fluid viewhelper on rendering, and after edition the comment this part will be gone.

The bug here is not related to Neos, but the the Blog plugin, who don't cleanup correctly the content of a comment (HTML code must be cleanup to allow only some HTML elements), if you can reproduce with a recent version of Neos and Blog package, please open an issue on github: https://github.com/robertlemke/RobertLemke.Plugin.Blog

I close this issue, if you don't agree with my comment feel free to open an issue on Jira, jira.typo3.org, (forge is not used any more for Flow and Neos), and add a link to this issue.

Also available in: Atom PDF