[BUGFIX] Fix column layout for New Content Element wizard 37/16837/6
authorMartin Kästner <mkaestner@gmx.de>
Wed, 28 Nov 2012 13:13:25 +0000 (14:13 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Thu, 30 Oct 2014 21:08:50 +0000 (22:08 +0100)
If adding new content elements in Web>List with the CE wizard,
you get the old column layout & titles even if you have a complete
backend_layout working.

But for Moving Elements the Backend Layout is already correct.
Column titles are already in $tcaItems a few lines before
the lines in the patch for File PagePositionMap.php. Using this
values the backend_layout is correct in Web>List CE Wizard.

Resolves: #42457
Releases: master, 6.2
Change-Id: I5f57aeac493ec5db02aaa92bd9eab97390cdb967
Reviewed-on: http://review.typo3.org/16837
Tested-by: Stefan Froemken <froemken@gmail.com>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php
typo3/sysext/backend/Classes/Tree/View/PagePositionMap.php

index 0649413..f6c23cb 100644 (file)
@@ -256,11 +256,12 @@ class NewContentElementController {
                                $this->content .= $this->doc->spacer(20);
                                // Select position
                                $code = $GLOBALS['LANG']->getLL('sel2', 1) . '<br /><br />';
+
                                // Load SHARED page-TSconfig settings and retrieve column list from there, if applicable:
-                               $modTSconfig_SHARED = BackendUtility::getModTSconfig($this->id, 'mod.SHARED');
-                               $colPosList = trim($modTSconfig_SHARED['properties']['colPos_list']) !== '' ? trim($modTSconfig_SHARED['properties']['colPos_list']) : '1,0,2,3';
-                               $colPosList = implode(',', array_unique(GeneralUtility::intExplode(',', $colPosList)));
+                               $colPosArray = GeneralUtility::callUserFunction('TYPO3\\CMS\\Backend\\View\\BackendLayoutView->getColPosListItemsParsed', $this->id, $this);
+                               $colPosIds = array_column($colPosArray, 1);
                                // Removing duplicates, if any
+                               $colPosList = implode(',', array_unique(array_map('intval', $colPosIds)));
                                // Finally, add the content of the column selector to the content:
                                $code .= $posMap->printContentElementColumns($this->id, 0, $colPosList, 1, $this->R_URI);
                                $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('2_selectPosition'), $code, 0, 1);
index 46c9228..f938a85 100644 (file)
@@ -419,11 +419,9 @@ class PagePositionMap {
                                        // Which tt_content colPos should be displayed inside this cell
                                        $columnKey = (int)$columnConfig['colPos'];
                                        $head = '';
-                                       $params = array();
-                                       $params['pid'] = $pid;
                                        foreach ($tcaItems as $item) {
                                                if ($item[1] == $columnKey) {
-                                                       $head = $GLOBALS['LANG']->sL(BackendUtility::getLabelFromItemlist('tt_content', 'colPos', $columnKey, $params), TRUE);
+                                                       $head = $GLOBALS['LANG']->sL($item[0], TRUE);
                                                }
                                        }
                                        // Render the grid cell