[BUGFIX] Form Wizard saving destroys Radio Buttons 71/26471/2
authorMarkus Klein <klein.t3@mfc-linz.at>
Mon, 18 Nov 2013 10:30:18 +0000 (11:30 +0100)
committerMarkus Klein <klein.t3@mfc-linz.at>
Wed, 8 Jan 2014 15:04:19 +0000 (16:04 +0100)
This fixes a wrong parsing of \r\n characters for radio
button options.

Resolves: #53727
Releases: 6.2, 6.1, 6.0
Change-Id: I9a88be010a7dd982776bee4a98ba99d97fcc406b
Reviewed-on: https://review.typo3.org/26471
Reviewed-by: Mario Rimann
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/backend/Classes/Controller/Wizard/FormsController.php

index 44c0d00..75216cb 100644 (file)
@@ -726,7 +726,12 @@ class FormsController {
                                        $thisLine[1] = str_replace('|', '', $thisLine[1]);
                                        // Default:
                                        if ($vv['type'] == 'select' || $vv['type'] == 'radio') {
-                                               $thisLine[2] = str_replace(LF, ', ', str_replace(',', '', $vv['options']));
+                                               $options = str_replace(',', '', $vv['options']);
+                                               $options = str_replace(
+                                                       array(CR . LF, CR, LF),
+                                                       ', ',
+                                                       $options);
+                                               $thisLine[2] = $options;
                                        } elseif ($vv['type'] == 'check') {
                                                if ($vv['default']) {
                                                        $thisLine[2] = 1;