Skip to content

Commit

Permalink
[BUGFIX] Avoid warnings triggered by SiteHandling tests
Browse files Browse the repository at this point in the history
A set of fixes for partially incomplete test setup in
functional tests and a series of undefined array index
warnings in system under test code.

Resolves: #95630
Releases: master
Change-Id: Ia628eb93912c85bee1e472367e2f209abec1abe3
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/71628
Tested-by: core-ci <typo3@b13.com>
Tested-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: Jochen <rothjochen@gmail.com>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Jochen <rothjochen@gmail.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
lolli42 committed Oct 13, 2021
1 parent 8c0f318 commit 7cf24b0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion typo3/sysext/core/Classes/Html/HtmlParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ public function HTMLparserConfig($TSconfig, $keepTags = [])
foreach ($TSconfig['tags.'] as $key => $tagC) {
if (is_array($tagC) && $key == strtolower($key)) {
$key = substr($key, 0, -1);
if (!is_array($keepTags[$key])) {
if (!is_array($keepTags[$key] ?? null)) {
$keepTags[$key] = [];
}
if (isset($tagC['fixAttrib.']) && is_array($tagC['fixAttrib.'])) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5039,7 +5039,7 @@ public function getTypoLink($label, $params, $urlParameters = [], $target = '')
$conf['additionalParams'] .= HttpUtility::buildQueryString($urlParameters, '&');
}
} else {
$conf['additionalParams'] .= $urlParameters;
$conf['additionalParams'] = ($conf['additionalParams'] ?? '') . $urlParameters;
}
$out = $this->typoLink($label, $conf);
return $out;
Expand Down
4 changes: 2 additions & 2 deletions typo3/sysext/frontend/Classes/Typolink/PageLinkBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,11 +463,11 @@ protected function getClosestMountPointValueForPage($pageId)
foreach ($tCR_rootline as $tCR_data) {
foreach ($inverseTmplRootline as $rlKey => $invTmplRLRec) {
// Force accumulating when in overlay mode: Links to this page have to stay within the current branch
if ($invTmplRLRec['_MOUNT_OL'] && (int)$tCR_data['uid'] === (int)$invTmplRLRec['uid']) {
if (($invTmplRLRec['_MOUNT_OL'] ?? false) && (int)$tCR_data['uid'] === (int)$invTmplRLRec['uid']) {
$startMPaccu = true;
}
// Accumulate MP data:
if ($startMPaccu && $invTmplRLRec['_MP_PARAM']) {
if ($startMPaccu && ($invTmplRLRec['_MP_PARAM'] ?? false)) {
$rl_mpArray[] = $invTmplRLRec['_MP_PARAM'];
}
// If two PIDs matches and this is NOT the site root, start accumulation of MP data (on the next level):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ protected function setUp(): void
$this->withDatabaseSnapshot(function () {
$this->setUpDatabase();
});

// @todo: This is ugly: backend user and lang object are needed for DH db snapshot operations
// already, but also need to be setup properly for subsequent tests, so its done here
// a second time for the first test. This should be changed somehow.
$this->setUpBackendUser(1);
Bootstrap::initializeLanguageObject();
}

protected function setUpDatabase(): void
Expand Down

0 comments on commit 7cf24b0

Please sign in to comment.