ZenphotoCMS Forum
albums text layout wrong after upgrade - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: albums text layout wrong after upgrade (/thread-10490.html)



albums text layout wrong after upgrade - cactux - 2012-10-09

Hello,

I recently upgraded to the latest version of Zenphoto (1.4.3.3).
Now the text on the albums lost all the line breaks (the carriage return).
It seems the html "BR" tag is missing.
In the database, the "desc" field of the "albums" table contains only newline characters, no BR. Before the upgrade Zenphoto displayed the text nicely, what should I do to have it work as before?

Thanks for your help




albums text layout wrong after upgrade - sbillard - 2012-10-09

the printField() function, the underlying code for all these print functions, has a parameter to control converting line breaks into HTML. It defaults to false, though. Making those conversions was messing up descriptions entered by the WYSIWYG editors.

Your best fix is to change the newline characters into tags in the database as ofcourse, browsers carefully ignore newline characters.

Or you could directly call the printField() function to print your descriptions and pass true as the $convertBR parameter.




albums text layout wrong after upgrade - cactux - 2012-10-10

Hello,

Thank you for your answer, I'll do a small PHP script to update the database, using the nl2br() function.

I'll do it this week-end and post it here in case it can help someone with the same problem.
Except if it is already available somewhere?




albums text layout wrong after upgrade - acrylian - 2012-10-10

To my knowledge this has never been reported before.




albums text layout wrong after upgrade - cactux - 2012-10-10

Hello,

Here is a script:




albums text layout wrong after upgrade - cactux - 2012-10-10

Inserting php code here is not a good result.
Here is the code in more readable format:
http://snipt.org/vfHi2