-
|
Hello, I'm processing a spreadsheet with line breaks in cells through Collective Access which appears to be using PhpSpreadsheet
Processing a spreadsheet as an .xls file returns the cell contents as expected with line breaks as newlines ( From a brief review of what seems like the relevant Collective Access code at https://github.com/collectiveaccess/providence/blob/a0a24298d69a23e3f5e58f0a5eec7796e415a38a/app/helpers/importHelpers.php#L1584-L1715 I'm wondering if this might be a PhpSpreadsheet issue? Here is an example cell: Spreadsheet saved as XLS and processed the cell is returned as: Spreadsheet saved as XLSX and processed the cell is returned as: any help or recommendations on whether this might be user error, a PHPSpreadsheet issue, or issue with the CollectiveAccess code is greatly appreciated. thanks |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
|
Although I will try to help, we are no longer updating the release of PhpSpreadsheet that you are using except for security patches, which clearly does not apply here. |
Beta Was this translation helpful? Give feedback.
-
|
Normally, PhpSpreadsheet does not output that string. Issue #347 is relevant here. PhpSpreadsheet replaced both cr/lf and cr alone with lf (i.e. newline) until PR #4536 and later #4619 earlier this year; neither PR was applied to your release. So, it might help if you show how you populated the cell in question in your code. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
oh - i had only reviewed the .xlsx file by exporting from excel to |
Beta Was this translation helpful? Give feedback.
-
|
no problem at all, thanks very much for clarifying things |
Beta Was this translation helpful? Give feedback.

Thank you for the information. It appears that PhpSpreadsheet never expected, and never handled
_x000D_. Well, it did briefly, I added support for it in PR #4536, but that caused some problems, so it had to be removed in PR #4619. I will work on another PR to re-add it, but, as noted above, that will not be applied to the release which you are using. I'm afraid you (or your framework) will have to handle this issue manually with astr_replacefor each cell to which it might apply if you cannot convince your framework to move to a supported version. Sorry.