Bug #81050
closedEmpty table row is added each time saving a Table CE
100%
Description
Steps to reproduce in TYPO3 CMS 8.7 LTS (composer; {nl}
= newline):
1) Create a new table CE
2) Add dummy content:
A | B | C 1 | 2 | 3
3) Save.
Content in DB is:
A | B | C 1 | 2 | 3
Content in textarea now is:
A | B | C 1 | 2 | 3 {nl}
3) Save again.
Content in DB is:
A | B | C 1 | 2 | 3 {nl}
Content in textarea now is:
A | B | C 1 | 2 | 3 {nl} {nl}
This behavior was introduced with 84be5e61 where the working part (see removed part)...
<textarea class="form-control" rows="' . $rows . '" disabled>' . $itemValue . '</textarea>
code was replaced with ..
$html[] = '<textarea class="form-control" rows="' . $rows . '" disabled>'; $html[] = htmlspecialchars($itemValue); $html[] = '</textarea>';
... which adds the extra newline character when generating the textarea.
Combining the 3 keys to one fixes this issue:
Index: vendor/typo3/cms/typo3/sysext/backend/Classes/Form/Element/TextTableElement.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- vendor/typo3/cms/typo3/sysext/backend/Classes/Form/Element/TextTableElement.php (revision ) +++ vendor/typo3/cms/typo3/sysext/backend/Classes/Form/Element/TextTableElement.php (revision ) @@ -190,9 +190,7 @@ $html[] = '<div class="form-control-wrap" style="max-width: ' . $width . 'px">'; $html[] = '<div class="form-wizards-wrap">'; $html[] = '<div class="form-wizards-element">'; - $html[] = '<textarea ' . GeneralUtility::implodeAttributes($attributes, true) . '>'; - $html[] = htmlspecialchars($itemValue); - $html[] = '</textarea>'; + $html[] = '<textarea ' . GeneralUtility::implodeAttributes($attributes, true) . '>'. htmlspecialchars($itemValue) . '</textarea>'; $html[] = '</div>'; $html[] = '<div class="form-wizards-items-aside">'; $html[] = '<div class="btn-group">';
Updated by Georg Tiefenbrunn over 7 years ago
Browser: Chrome 58.0.3029.81 (64-bit) on macOS 10.12.4
Updated by Wouter Wolters over 7 years ago
Would you mind pushing a patch to Gerrit?
https://docs.typo3.org/typo3cms/ContributionWorkflowGuide/
If you have questions/problems just contact us on Slack in the #typo3-cms-coredev channel.
Updated by Gerrit Code Review over 7 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/52658
Updated by Gerrit Code Review over 7 years ago
Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/52685
Updated by Henrik Elsner over 7 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset cef81b4f179d8fb742ab89b0e62955316af46e8f.