[BUGFIX] Do not provide non selectable columns in colPos selector 25/50225/2
authorHelmut Hummel <info@helhum.io>
Mon, 10 Oct 2016 18:04:15 +0000 (20:04 +0200)
committerFrank Naegler <frank.naegler@typo3.org>
Fri, 14 Oct 2016 09:47:22 +0000 (11:47 +0200)
When a backend layout is active for a page, editing a content
element will have the "columns" of this layout selectable
in the "colPos" drop down selector.

Now this select box does not include the backend layout columns without
assigned colPos any more, because these are not meant to have content
anyway and selecting such a column would put the content element into column
with colPos 0

Resolves: #78223
Releases: master, 7.6
Change-Id: I7b44cbe26adabc4028ee874bea5fa63f7127d118
Reviewed-on: https://review.typo3.org/50225
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/backend/Classes/View/BackendLayoutView.php

index 321e9d8..25ac890 100644 (file)
@@ -360,6 +360,9 @@ class BackendLayoutView implements \TYPO3\CMS\Core\SingletonInterface
                 foreach ($backendLayoutData['__config']['backend_layout.']['rows.'] as $row) {
                     if (!empty($row['columns.'])) {
                         foreach ($row['columns.'] as $column) {
+                            if (!isset($column['colPos'])) {
+                                continue;
+                            }
                             $backendLayoutData['__items'][] = [
                                 GeneralUtility::isFirstPartOfStr($column['name'], 'LLL:') ? $this->getLanguageService()->sL($column['name']) : $column['name'],
                                 $column['colPos'],