Details
-
Bug
-
Resolution: Fixed
-
Blocker
-
5.4.9
-
None
Description
EZP-26224 has a script to fix bad formed values in XML Text, namely \xc2\x92 and
  characters.
When the script is executed, it duplicates the latest version to all stored versions, effectively deleting the old content.
The problem seems to come from updatenbxmlcontents.php#L7 and a possible solution could be proceeding with the following changes, but it still needs to be tested.
Unable to find source-code formatter for language: diff. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
- $db->query( "UPDATE ezcontentobject_attribute SET data_text='$xmlData' WHERE id='$id'" ); + $db->query( "UPDATE ezcontentobject_attribute SET data_text='$xmlData' WHERE id='$id' and version='$version'" );
Steps to reproduce
- Create a new article with the API and add the following lines to the XML Text (Edit the comment and copy the lines from the plain text version)
<?xml version="1.0" encoding="utf-8"?> <section xmlns:image="http://ez.no/namespaces/ezpublish3/image/" xmlns:xhtml="http://ez.no/namespaces/ezpublish3/xhtml/" xmlns:custom="http://ez.no/namespaces/ezpublish3/custom/"> <paragraph>Antes tarde do que...&nbsp;mais nunca.’</paragraph> <paragraph>Há males que vêm para...&nbsp;para o mal.’</paragraph> </section>
- Open the backend and create three versions. Add Edit #00x to the first line of each of the versions.
- Execute the script
cd ezpublish_legacy php update/common/scripts/updatenbxmlcontents.php -n
- Clear the caches
- Confirm the versions were changed to the latest version