ODT new line in templates

Situation
I have a LBF that I use for operation reports. I have created a .ODT template and successfully had the fields from the LBF populate the template, however it prints them all in one continuous paragraph despite multiple new lines in the textarea fields in the LBF.

I have searched the forums, and see that this was subject to a bug report a couple of years ago #6868 which should have been fixed and committed.

Nevertheless, I am still not seeing linefeeds on textarea fields.

OpenEMR Version
I’m using OpenEMR version 7.0.3 (4)

Browser:
I’m using: Edge, Safari, Chrome - no difference

Operating System
I’m using: Windows, OSX

Search
Did you search the forum for similar questions? Yes - see above

Logs
Did you check the logs? Yes - see above - bug report #6868

Issue solved (I think), and reported in GitHub repo here (9967):
https://github.com/openemr/openemr/issues/9967

In line 361, $ext is defined as an output of functions that takes the variable $filename
$ext = strtolower(array_pop(explode(ā€˜.’, $filename)));

$filename is not defined - this is the only place that it should appear in the code. As a result, $ext should be null, which means that the conditional statement in line 68 that adds newlines does not execute.

Changing line 361 to:
$ext = strtolower(array_pop(explode(ā€˜.’, $form_filename)));
fixes this problem. The variable $form_filename is defined on line 352.

The .odt file now includes line breaks.

1 Like