Index: typo3/sysext/indexed_search/modfunc1/class.tx_indexedsearch_modfunc1.php =================================================================== --- typo3/sysext/indexed_search/modfunc1/class.tx_indexedsearch_modfunc1.php (revision 10120) +++ typo3/sysext/indexed_search/modfunc1/class.tx_indexedsearch_modfunc1.php (revision ) @@ -635,13 +635,13 @@ $this->utf8_to_currentCharset(t3lib_div::view_array($phashRecord)); // Getting debug information if any: - $ftrows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows( + $ftrow = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow( '*', 'index_debug', 'phash = '.intval($phash) ); - if (is_array($ftrows)) { - $debugInfo = unserialize($ftrows[0]['debuginfo']); + if (is_array($ftrow)) { + $debugInfo = unserialize($ftrow['debuginfo']); $lexer = $debugInfo['lexer']; unset($debugInfo['lexer']); Index: typo3/sysext/cms/classes/class.tx_cms_backendlayout.php =================================================================== --- typo3/sysext/cms/classes/class.tx_cms_backendlayout.php (revision 10201) +++ typo3/sysext/cms/classes/class.tx_cms_backendlayout.php (revision ) @@ -34,8 +34,17 @@ * @return void */ public function colPosListItemProcFunc(&$params) { + if ($params['row']['pid'] > 0) { - $params['items'] = $this->addColPosListLayoutItems($params['row']['pid'], $params['items']); + $params['items'] = $this->addColPosListLayoutItems($params['row']['pid'], $params['items']); + } else { + // negative uid_pid values indicate that the element has been inserted after an existing element + // so there is no pid to get the backendLayout for and we have to get that first + $existingElement = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('pid','tt_content','uid=' . -(intval($params['row']['pid']))); + if($existingElement['pid'] > 0) { + $params['items'] = $this->addColPosListLayoutItems($existingElement['pid'], $params['items']); - } + } + } + } /** * Adds items to a colpos list @@ -74,8 +83,12 @@ } foreach (t3lib_div::trimExplode(',', $tsConfig['properties']['removeItems'], 1) as $removeId) { - unset($tcaItems[$removeId]); + foreach ($tcaItems as $key => $item) { + if ($item[1] == $removeId) { + unset($tcaItems[$key]); - } + } + } + } return $tcaItems; } @@ -96,17 +109,20 @@ 'pages', 'uid=' . intval($rootline[$i]['uid']) ); - - if (intval($page['backend_layout_next_level']) > 0 && $page['uid'] != $id) { - $backendLayoutUid = intval($page['backend_layout_next_level']); + $selectedBackendLayout = intval($page['backend_layout']); + $selectedBackendLayoutNextLevel = intval($page['backend_layout_next_level']); + if ($selectedBackendLayout != 0 && $page['uid'] == $id) { + if ($selectedBackendLayout > 0) { + $backendLayoutUid = $selectedBackendLayout; + } break; - } else { - if (intval($page['backend_layout']) > 0) { - $backendLayoutUid = intval($page['backend_layout']); + } else if ($selectedBackendLayoutNextLevel == -1 && $page['uid'] != $id) { - break; + break; + } else if ($selectedBackendLayoutNextLevel > 0 && $page['uid'] != $id) { + $backendLayoutUid = $selectedBackendLayoutNextLevel; + break; - } - } + } + } - } $backendLayout = NULL; if ($backendLayoutUid) { @@ -116,7 +132,7 @@ 'uid=' . $backendLayoutUid ); - if ($backendLayout) { + if (intval($backendLayout['uid']) > 0) { $parser = t3lib_div::makeInstance('t3lib_TSparser'); $parser->parse($backendLayout['config']); @@ -151,4 +167,4 @@ include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/cms/classes/class.tx_cms_backendlayout.php']); } -?> \ No newline at end of file +?> Index: typo3/sysext/extbase/Classes/Configuration/BackendConfigurationManager.php =================================================================== --- typo3/sysext/extbase/Classes/Configuration/BackendConfigurationManager.php (revision 10261) +++ typo3/sysext/extbase/Classes/Configuration/BackendConfigurationManager.php (revision ) @@ -112,15 +112,15 @@ } // get current site root - $rootPages = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid', 'pages', 'deleted=0 AND hidden=0 AND is_siteroot=1', '', '', '1'); - if (count($rootPages) > 0) { - return $rootPages[0]['uid']; + $rootPage = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('uid', 'pages', 'deleted=0 AND hidden=0 AND is_siteroot=1'); + if (intval($rootPage['uid']) > 0) { + return $rootPage['uid']; } // get root template - $rootTemplates = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('pid', 'sys_template', 'deleted=0 AND hidden=0 AND root=1', '', '', '1'); - if (count($rootTemplates) > 0) { - return $rootTemplates[0]['pid']; + $rootTemplate = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('pid', 'sys_template', 'deleted=0 AND hidden=0 AND root=1'); + if (intval($rootTemplate['pid']) > 0) { + return $rootTemplate['pid']; } // fallback Index: tests/t3lib/t3lib_dbTest.php =================================================================== --- tests/t3lib/t3lib_dbTest.php (revision 10121) +++ tests/t3lib/t3lib_dbTest.php (revision ) @@ -80,7 +80,7 @@ $id = $this->fixture->sql_insert_id(); - $entry = $this->fixture->exec_SELECTgetRows( + $entry = $this->fixture->exec_SELECTgetSingleRow( 'fieldblob', $this->testTable, 'id = ' . $id @@ -88,7 +88,7 @@ $this->assertEquals( $binaryString, - $entry[0]['fieldblob'] + $entry['fieldblob'] ); } @@ -105,7 +105,7 @@ $id = $this->fixture->sql_insert_id(); - $entry = $this->fixture->exec_SELECTgetRows( + $entry = $this->fixture->exec_SELECTgetSingleRow( 'fieldblob', $this->testTable, 'id = ' . $id @@ -113,7 +113,7 @@ $this->assertEquals( $testStringWithBinary, - $entry[0]['fieldblob'] + $entry['fieldblob'] ); } Index: typo3/sysext/linkvalidator/classes/linktype/class.tx_linkvalidator_linktype_internal.php =================================================================== --- typo3/sysext/linkvalidator/classes/linktype/class.tx_linkvalidator_linktype_internal.php (revision 10261) +++ typo3/sysext/linkvalidator/classes/linktype/class.tx_linkvalidator_linktype_internal.php (revision ) @@ -118,25 +118,25 @@ * @return string TRUE on success or FALSE on error */ protected function checkPage($page, $softRefEntry, $reference) { - $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows( + $row = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow( 'uid, title, deleted, hidden, starttime, endtime', 'pages', 'uid = ' . intval($page) ); $this->responsePage = TRUE; - if ($rows[0]) { - if ($rows[0]['deleted'] == '1') { + if ($row) { + if ($row['deleted'] == '1') { $this->errorParams['errorType']['page'] = DELETED; - $this->errorParams['page']['title'] = $rows[0]['title']; - $this->errorParams['page']['uid'] = $rows[0]['uid']; + $this->errorParams['page']['title'] = $row['title']; + $this->errorParams['page']['uid'] = $row['uid']; $this->responsePage = FALSE; - } elseif ($rows[0]['hidden'] == '1' - || $GLOBALS['EXEC_TIME'] < intval($rows[0]['starttime']) - || ($rows[0]['endtime'] && intval($rows[0]['endtime']) < $GLOBALS['EXEC_TIME'])) { + } elseif ($row['hidden'] == '1' + || $GLOBALS['EXEC_TIME'] < intval($row['starttime']) + || ($row['endtime'] && intval($row['endtime']) < $GLOBALS['EXEC_TIME'])) { $this->errorParams['errorType']['page'] = HIDDEN; - $this->errorParams['page']['title'] = $rows[0]['title']; - $this->errorParams['page']['uid'] = $rows[0]['uid']; + $this->errorParams['page']['title'] = $row['title']; + $this->errorParams['page']['uid'] = $row['uid']; $this->responsePage = FALSE; } } else { @@ -159,7 +159,7 @@ */ protected function checkContent($page, $anchor, $softRefEntry, $reference) { // Get page ID on which the content element in fact is located - $res = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows( + $res = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow( 'uid, pid, header, deleted, hidden, starttime, endtime', 'tt_content', 'uid = ' . intval($anchor) @@ -167,9 +167,9 @@ $this->responseContent = TRUE; // this content element exists - if ($res[0]) { + if ($res) { // page ID on which this CE is in fact located. - $correctPageID = $res[0]['pid']; + $correctPageID = $res['pid']; // check if the element is on the linked page // (the element might have been moved to another page) @@ -182,17 +182,17 @@ } else { // the element is located on the page to which the link is pointing - if ($res[0]['deleted'] == '1') { + if ($res['deleted'] == '1') { $this->errorParams['errorType']['content'] = DELETED; - $this->errorParams['content']['title'] = $res[0]['header']; - $this->errorParams['content']['uid'] = $res[0]['uid']; + $this->errorParams['content']['title'] = $res['header']; + $this->errorParams['content']['uid'] = $res['uid']; $this->responseContent = FALSE; - } elseif ($res[0]['hidden'] == '1' - || $GLOBALS['EXEC_TIME'] < intval($res[0]['starttime']) - || ($res[0]['endtime'] && intval($res[0]['endtime']) < $GLOBALS['EXEC_TIME'])) { + } elseif ($res['hidden'] == '1' + || $GLOBALS['EXEC_TIME'] < intval($res['starttime']) + || ($res['endtime'] && intval($res['endtime']) < $GLOBALS['EXEC_TIME'])) { $this->errorParams['errorType']['content'] = HIDDEN; - $this->errorParams['content']['title'] = $res[0]['header']; - $this->errorParams['content']['uid'] = $res[0]['uid']; + $this->errorParams['content']['title'] = $res['header']; + $this->errorParams['content']['uid'] = $res['uid']; $this->responseContent = FALSE; } } Index: typo3/sysext/cms/layout/wizard_backend_layout.php =================================================================== --- typo3/sysext/cms/layout/wizard_backend_layout.php (revision 10200) +++ typo3/sysext/cms/layout/wizard_backend_layout.php (revision ) @@ -105,8 +105,8 @@ $pageRenderer->addInlineLanguageLabelArray($languageLabels); // select record - $record = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows($this->P['field'], $this->P['table'], 'uid=' . intval($this->P['uid'])); - if (trim($record[0][$this->P['field']]) == '') { + $record = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow($this->P['field'], $this->P['table'], 'uid=' . intval($this->P['uid'])); + if (trim($record[$this->P['field']]) == '') { $t3GridData = "[[{colspan:1,rowspan:1,spanned:false,name:''}]]"; $colCount = 1; $rowCount = 1; @@ -114,7 +114,7 @@ // load TS parser $parser = t3lib_div::makeInstance('t3lib_TSparser'); - $parser->parse($record[0][$this->P['field']]); + $parser->parse($record[$this->P['field']]); $data = $parser->setup['backend_layout.']; $t3GridData = '['; $colCount = $data['colCount']; Index: t3lib/class.t3lib_browsetree.php =================================================================== --- t3lib/class.t3lib_browsetree.php (revision 10121) +++ t3lib/class.t3lib_browsetree.php (revision ) @@ -151,10 +151,10 @@ // get the basic title from the parent implementation in t3lib_treeview $title = parent::getTitleStr($row, $titleLen); if (isset($row['is_siteroot']) && $row['is_siteroot'] != 0 && $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showDomainNameWithTitle')) { - $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('domainName,sorting', 'sys_domain', - 'pid=' . $GLOBALS['TYPO3_DB']->quoteStr($row['uid'] . t3lib_BEfunc::deleteClause('sys_domain') . t3lib_BEfunc::BEenableFields('sys_domain'), 'sys_domain'), '', 'sorting', 1); - if (is_array($rows) && count($rows) > 0) { - $title = sprintf('%s [%s]', $title, htmlspecialchars($rows[0]['domainName'])); + $row = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('domainName,sorting', 'sys_domain', + 'pid=' . $GLOBALS['TYPO3_DB']->quoteStr($row['uid'] . t3lib_BEfunc::deleteClause('sys_domain') . t3lib_BEfunc::BEenableFields('sys_domain'), 'sys_domain'), '', 'sorting'); + if (is_array($row) && count($row) > 0) { + $title = sprintf('%s [%s]', $title, htmlspecialchars($row['domainName'])); } } return $title; Index: typo3/sysext/linkvalidator/classes/linktype/class.tx_linkvalidator_linktype_linkhandler.php =================================================================== --- typo3/sysext/linkvalidator/classes/linktype/class.tx_linkvalidator_linktype_linkhandler.php (revision 10261) +++ typo3/sysext/linkvalidator/classes/linktype/class.tx_linkvalidator_linktype_linkhandler.php (revision ) @@ -63,14 +63,14 @@ if (count($parts) == 3) { $tableName = htmlspecialchars($parts[1]); $rowid = intval($parts[2]); - $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows( + $row = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow( '*', $tableName, 'uid = ' . intval($rowid) ); - if ($rows[0]) { - if ($rows[0]['deleted'] == '1') { + if ($row) { + if ($row['deleted'] == '1') { $errorParams['errorType'] = DELETED; $errorParams['tablename'] = $tableName; $errorParams['uid'] = $rowid;