Commit 247da0fa authored by Alexander Schnitzler's avatar Alexander Schnitzler Committed by Andreas Fernandez
Browse files

[TASK] Avoid possibly undefined variables

phpstan identified a bunch of possibly undefined
variables which is fixed with this patch.

Releases: master
Resolves: #90581
Change-Id: If41bee3dcd972d26f8eff18dbcbc61ad1fe79e7f
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63483


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Frank Nägler's avatarFrank Nägler <frank.naegler@typo3.org>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: default avatarGuido Schmechel <guido.schmechel@brandung.de>
Reviewed-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Frank Nägler's avatarFrank Nägler <frank.naegler@typo3.org>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
parent ab5d305b
......@@ -703,8 +703,8 @@ class PageLayoutController
}
$this->pageRenderer->addInlineLanguageLabelFile('EXT:backend/Resources/Private/Language/locallang_layout.xlf');
$h_func_b = '';
if ($this->getBackendUser()->check('tables_select', 'tt_content')) {
$h_func_b = '';
// Toggle hidden ContentElements
if ($numberOfHiddenElements > 0) {
......
......@@ -83,6 +83,7 @@ class TcaFlexPrepare implements FormDataProviderInterface
);
$dataStructureArray = $flexFormTools->parseDataStructureByIdentifier($dataStructureIdentifier);
} catch (InvalidParentRowException|InvalidParentRowLoopException|InvalidParentRowRootException|InvalidPointerFieldValueException|InvalidIdentifierException $e) {
$dataStructureIdentifier = null;
} finally {
// Add the identifier to TCA to use it later during rendering
$result['processedTca']['columns'][$fieldName]['config']['dataStructureIdentifier'] = $dataStructureIdentifier;
......
......@@ -521,6 +521,8 @@ class PageLayoutView implements LoggerAwareInterface
// Add colgroups
$colCount = (int)$backendLayout['__config']['backend_layout.']['colCount'];
$rowCount = (int)$backendLayout['__config']['backend_layout.']['rowCount'];
$colSpan = 0;
$rowSpan = 0;
$grid .= '<colgroup>';
for ($i = 0; $i < $colCount; $i++) {
$grid .= '<col />';
......
......@@ -375,6 +375,7 @@ class BackendUserAuthentication extends AbstractUserAuthentication
if (!$GLOBALS['TYPO3_CONF_VARS']['BE']['lockBeUserToDBmounts'] || $this->isAdmin()) {
return 1;
}
$checkRec = [];
$fetchPageFromDatabase = true;
if (is_array($idOrRow)) {
if (empty($idOrRow['uid'])) {
......
......@@ -5655,6 +5655,7 @@ class DataHandler implements LoggerAwareInterface
$remapFlexForms = [];
$hookPayload = [];
$newValue = null;
foreach ($this->remapStack as $remapAction) {
// If no position index for the arguments was set, skip this remap action:
if (!is_array($remapAction['pos'])) {
......
......@@ -668,6 +668,7 @@ class CrawlerHook
$indexerObj->backend_setFreeIndexUid($cfgRec['uid'], $cfgRec['set_id']);
$indexerObj->forceIndexing = true;
$theContent = '';
$theTitle = '';
foreach ($fieldList as $k => $v) {
if (!$k) {
$theTitle = $r[$v];
......
......@@ -706,6 +706,7 @@ class Indexer
$expBody = preg_split('/\\<\\!\\-\\-[\\s]?TYPO3SEARCH_/', $body);
if (count($expBody) > 1) {
$body = '';
$prev = '';
foreach ($expBody as $val) {
$part = explode('-->', $val, 2);
if (trim($part[0]) === 'begin') {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment