Skip to content
Snippets Groups Projects
Commit 9773f7b9 authored by Jochen Roth's avatar Jochen Roth Committed by Georg Ringer
Browse files

[BUGFIX] Undefined array key in ElementInformation

A click on inline fal ElementInformation button leads to
Undefined array key "returnUrl".
Fixed by adding empty string as fallback and add an
acceptance test to make sure it will not appear again.

Resolves: #94400
Releases: master
Change-Id: I7e44b026f81b0d484e3b8a1af5522fece228d5d4
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69544


Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
parent f0165a61
Branches
Tags
No related merge requests found
......@@ -259,7 +259,7 @@ class ElementInformationController
$view->assignMultiple($this->getPreview());
$view->assignMultiple($this->getPropertiesForTable());
$view->assignMultiple($this->getReferences($request));
$view->assign('returnUrl', GeneralUtility::sanitizeLocalUrl($request->getQueryParams()['returnUrl']));
$view->assign('returnUrl', GeneralUtility::sanitizeLocalUrl($request->getQueryParams()['returnUrl'] ?? ''));
$view->assign('maxTitleLength', $this->getBackendUser()->uc['titleLen'] ?? 20);
$content .= $view->render();
}
......
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Core\Tests\Acceptance\Backend\FormEngine;
use TYPO3\CMS\Core\Tests\Acceptance\Support\BackendTester;
use TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog;
use TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\PageTree;
/**
* Tests for inline fal
*/
class InlineFalCest
{
protected static string $filenameSelector = '.tab-content .form-irre-header-cell .form-irre-header-body dd';
protected static string $saveButtonLink = '//*/button[@name="_savedok"][1]';
/**
* Open styleguide inline fal page in list module
*
* @param BackendTester $I
* @param PageTree $pageTree
* @throws \Exception
*/
public function _before(BackendTester $I, PageTree $pageTree)
{
$I->useExistingSession('admin');
$I->click('List');
$I->waitForElement('svg .nodes .node');
$pageTree->openPath(['styleguide TCA demo', 'inline fal']);
$I->switchToContentFrame();
$I->waitForText('inline fal', 20);
$editRecordLinkCssPath = '#recordlist-tx_styleguide_inline_fal a[data-bs-original-title="Edit record"]';
$I->click($editRecordLinkCssPath);
$I->waitForText('Edit Form', 3, 'h1');
}
/**
* @param BackendTester $I
* @param ModalDialog $modalDialog
*/
public function seeFalRelationInfo(BackendTester $I, ModalDialog $modalDialog)
{
$infoButtonSelector = '.tab-content button[data-action="infowindow"]';
$filename = $I->grabTextFrom(self::$filenameSelector);
$I->click($infoButtonSelector);
$modalDialog->canSeeDialog();
$I->switchToIFrame('.modal-iframe');
$modalTitle = $I->grabTextFrom('.card-title');
$I->assertContains($filename, $modalTitle);
}
/**
* @param BackendTester $I
*/
public function hideFalRelation(BackendTester $I)
{
$hideButtonSelector = '.tab-content .t3js-toggle-visibility-button';
$I->click($hideButtonSelector);
$I->click(self::$saveButtonLink);
$I->seeElement('.tab-content .t3-form-field-container-inline-hidden');
}
/**
* @param BackendTester $I
* @param ModalDialog $modalDialog
*/
public function deleteFalRelation(BackendTester $I, ModalDialog $modalDialog)
{
$deleteButtonSelector = '.tab-content .t3js-editform-delete-inline-record';
$filename = $I->grabTextFrom(self::$filenameSelector);
$I->click($deleteButtonSelector);
$modalDialog->canSeeDialog();
$I->click('button[name="yes"]', ModalDialog::$openedModalButtonContainerSelector);
$I->switchToContentFrame();
$I->click(self::$saveButtonLink);
$I->dontSee($filename, '.tab-content .form-section:first-child');
}
}
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