[BUGFIX] Use array in check for new CE button 03/17503/2
authorJigal van Hemert <jigal@xs4all.nl>
Sun, 13 Jan 2013 09:42:41 +0000 (10:42 +0100)
committerJigal van Hemert <jigal@xs4all.nl>
Sun, 13 Jan 2013 09:47:00 +0000 (10:47 +0100)
After #44470 the content elements in a column are stored in an array.
Checks for the new content element button, etcetera must check that
array instead of counting the elements in the query result that was used
before.

Change-Id: Iea75afd343db82a4950b4a9b7587177940398b2b
Fixes: #44481
Releases: 6.1, 6.0
Reviewed-on: https://review.typo3.org/17503
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
typo3/sysext/backend/Classes/View/PageLayoutView.php

index dc61993..8c61e3b 100644 (file)
@@ -679,9 +679,10 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                                foreach ($cList as $counter => $key) {
                                        $c = 0;
                                        $rowArr = $contentRecordsPerColumn[$key];
+                                       $numberOfContentElementsInColumn = count($rowArr);
                                        $rowOut = '';
                                        // If it turns out that there are not content elements in the column, then display a big button which links directly to the wizard script:
-                                       if ($this->doEdit && $this->option_showBigButtons && !intval($key) && !$GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
+                                       if ($this->doEdit && $this->option_showBigButtons && !intval($key) && $numberOfContentElementsInColumn == 0) {
                                                $onClick = 'window.location.href=\'db_new_content_el.php?id=' . $id . '&colPos=' . intval($key) . '&sys_language_uid=' . $lP . '&uid_pid=' . $id . '&returnUrl=' . rawurlencode(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REQUEST_URI')) . '\';';
                                                $theNewButton = $GLOBALS['SOBE']->doc->t3Button($onClick, $GLOBALS['LANG']->getLL('newPageContent'));
                                                $theNewButton = '<img src="clear.gif" width="1" height="5" alt="" /><br />' . $theNewButton;
@@ -703,7 +704,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                                                                        <td' . ($row['_ORIG_uid'] ? ' class="ver-element"' : '') . ' valign="top">' . $this->tt_content_drawItem($row, $isRTE) . '</td>
                                                                </tr>';
                                                        // If the element was not the last element, add a divider line:
-                                                       if ($c != $GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
+                                                       if ($c != $numberOfContentElementsInColumn) {
                                                                $rowOut .= '
                                                                <tr>
                                                                        <td></td>