View Full Version : Auto newlines broken on v6.3.28
cepheid
12-14-2009, 08:06 PM
It appears that v6.3.28 broke the automatic newline functionality, where EPC will automatically insert a <br> wherever a newline exists in the event description. This problem did NOT occur in 6.3.24, so the bug was introduced sometime after that.
For example, in 6.3.24, if my event description looked like:
this is
a test
... then EPC would display it exactly like that (with a linebreak between "this is" and "a test"). However, v6.3.28 displays it like:
"this isa test"
... in other words, it completely ignores the newline and concatenates all the text together.
This is obviously a huge issue, because it means that all of my event descriptions are now unreadable. The workaround is to manually enter <br> on every line, but editing all of my previous events is a huge burden.
For now, I can't upgrade to the latest version because of this bug... it'd be great if this could be fixed ASAP.
Brian
12-14-2009, 08:08 PM
You should turn off Allow HTML. If you want to use HTML, it will need the proper HTML to denote new lines.
cepheid
12-14-2009, 08:13 PM
I must have HTML in my descriptions, so I can't turn it off. You're saying now I must go back and edit all my previous entries, if I want to retain HTML?
Why was this behavior changed between 6.3.24 and 6.3.28? Could you possibly include a checkbox to allow the previous behavior? Is there any technical limitation that prevents the previous method from working, since it used to work on 6.3.24 and prior versions?
Editing hundreds of events is just not feasible, so now I'm stuck with this older version and cannot benefit from any of the newer bug/security fixes.
Brian
12-14-2009, 08:24 PM
This was changed over two years ago. Some servers would not properly execute the nl2br PHP command and it had to be removed to ensure compatibility.
The downside of that change was that if proper HTML didn't exist in events for line breaks, it would no longer create a new line (on some servers - like yours it seems).
Unfortunately, for compatibility, it would need to remain the way it is now which works no matter what server it is used on.
cepheid
12-14-2009, 08:30 PM
Brian,
Thanks for the detailed reply. Would it not be possible to include an "expert" option in config.inc.php to re-enable the previous setting, one that must be manually enabled by editing the file? That way, it's not a checkbox that anyone can turn on by accident, but it would allow those of us who need the feature to turn it on manually... since it's an "expert only" option with no GUI interface, it could be an "at your own risk" option... I think you already have a couple of such things in place, no?
This would be a huge help, if you could enable it... under normal circumstances, nl2br would not be used, so it shouldn't cause any problems on anyone's server, and anyone who enables it would do so manually under the knowledge that it may not work if they have not tested it previously.
Otherwise, I just have to stay with the older version, which is a shame...
Brian
12-14-2009, 08:38 PM
I don't have that source any longer, and I'm not sure where in the code this change would need to be made to make it like it was before. So it would take a bit of work to do to reprogram for this feature (for only one installation...).
Where does it seems to affect you? In the pop-ups or List Mode?
ve9gra
12-14-2009, 09:05 PM
If you are using the mySQL database, I'm pretty sure that I could just run a script to replace all of the \n (newlines) with <br> so that your line-breaks would work again.
Going forward, I suggest you use an HTML editor, as they will create the <br> when simply doing a carriage return, without you having to type it out.
cepheid
12-14-2009, 10:03 PM
Where does it seems to affect you? In the pop-ups or List Mode?Both... the pop-ups and the list mode are both missing their newlines. The actual event description still has them (i.e. if I edit the event, the description still shows up with its newlines), it's just the HTML display that omits them.
If you are using the mySQL databaseI'm not, I'm using the flatfile method. I'd like to switch over to the database so that I'll be ready for EPC 7 whenever it comes out... I know you have a converter script, if you're willing to send it, I'd love to use it. (I'm pretty UNIX-savvy so even if it's not too user-friendly, I can probably figure out how to use it.)
Going forward, I suggest you use an HTML editor, as they will create the <br> when simply doing a carriage return, without you having to type it out.Do you mean one of the advanced editors that EPC supports, or do you mean making my event descriptions externally and copying/pasting them in? The latter is not a workable solution; as for the former, I can consider doing that if that will work, although I'm hoping this can just be taken care of in the display code...
ve9gra
12-15-2009, 06:55 AM
I won't release the converter script as it ties directly into pieces of EPC that are still under NDA. I can, however, convert your database to mySQL for you, and do the parsing at the same time. Alternatively, since you are using the flat-file, you can use a simple text editor that is aware of line breaks and do a search and replace. Basically, add a <br> at each end of line.
As for the editor, I meant the integrated HTML editors that EPC supports. I say that because, as Brian explained, if you have HTML enabled in the descriptions, you need to provide valid HTML... and not simply plain-text.
cepheid
12-15-2009, 05:24 PM
I'm happy to sign an NDA to use the script. :) If that's not an option, I'll probably send you the flatfile at some point in the future, when we are ready to transition. I greatly appreciate the offer.
I'll try installing one of the integrated HTML editors and see if that is an acceptable workaround for future entries.
Thanks.
ve9gra
12-15-2009, 05:57 PM
I am bound by the NDA... so I'm the one that can't disclose anything. Like you can see in my sig, I'm not part of EPC, and Brian was kind enough to let me have access to some code to try and make this work.
My original intent was to get it to work and then give the code to Brian for inclusion in the EPC package, but since v6 has become feature frozen, it just didn't make sense to spend any more time on it to polish it.
When you're ready for the conversion (you should do this before considering v7), contact me using the link in my sig.
cepheid
12-15-2009, 06:47 PM
Shouldn't v7 include a converter so that people can easily upgrade from v6? Of course, that has nothing to do with the newlines, just wondering aloud. :)
I'll contact you when ready, thanks again for the offer.
Brian
12-15-2009, 07:03 PM
Yes. There will be a database converter from V6 to V7.
vBulletin® v3.8.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.