Commit fb67447d authored by Jochen Roth's avatar Jochen Roth Committed by Christian Kuhn
Browse files

[BUGFIX] Undefined array key in install tool

A click on "Image Processing", "Configure Installation-Wide Options"
or "Configuration Presets" in the install tool returns
an error in PHP8.

Add fallback for unefined array keys to workaround
the array undefined key warnings.

Add acceptance tests for InstallTool -> Settings module
to make sure settings of each card can be loaded and saved.

Resolves: #94425
Releases: master
Change-Id: Icf3b11b0e4c490f8054605cd531f77906dfa7ac6
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69633

Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent f0d038e4
......@@ -247,7 +247,13 @@ class ModuleMenu {
deferred.then((): void => {
this.initializeModuleMenuEvents();
Viewport.Topbar.Toolbar.registerEvent(() => this.initializeTopBarEvents());
Viewport.Topbar.Toolbar.registerEvent(() => {
// Only initialize top bar events when top bar exists.
// E.g. install tool has no top bar
if(document.querySelector('.t3js-scaffold-toolbar')) {
this.initializeTopBarEvents()
}
});
});
}
......
......@@ -10,4 +10,4 @@
*
* The TYPO3 project - inspiring people to share!
*/
var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};define(["require","exports","./Enum/Viewport/ScaffoldIdentifier","./Module","jquery","./Storage/Persistent","./Viewport","./Event/ClientRequest","./Event/TriggerRequest","TYPO3/CMS/Core/Ajax/AjaxRequest","TYPO3/CMS/Core/Event/RegularEvent"],(function(e,t,n,o,a,l,i,r,s,d,u){"use strict";a=__importDefault(a);class m{constructor(){this.loadedModule=null,this.spaceKeyPressedOnCollapsible=!1,a.default(()=>this.initialize())}static getCollapsedMainMenuItems(){return l.isset("modulemenu")?JSON.parse(l.get("modulemenu")):{}}static addCollapsedMainMenuItem(e){const t=m.getCollapsedMainMenuItems();t[e]=!0,l.set("modulemenu",JSON.stringify(t))}static removeCollapseMainMenuItem(e){const t=this.getCollapsedMainMenuItems();delete t[e],l.set("modulemenu",JSON.stringify(t))}static includeId(e,t){if(!e.navigationComponentId&&!e.navigationFrameScript)return t;let n="";return n="TYPO3/CMS/Backend/PageTree/PageTreeElement"===e.navigationComponentId?"web":e.name.split("_")[0],top.fsMod.recentIds[n]&&(t="id="+top.fsMod.recentIds[n]+"&"+t),t}static toggleMenu(e){const t=a.default(n.ScaffoldIdentifierEnum.scaffold);void 0===e&&(e=t.hasClass("scaffold-modulemenu-expanded")),t.toggleClass("scaffold-modulemenu-expanded",!e),e||a.default(".scaffold").removeClass("scaffold-search-expanded").removeClass("scaffold-toolbar-expanded"),l.set("BackendComponents.States.typo3-module-menu",{collapsed:e})}static toggleModuleGroup(e){const t=e.closest(".modulemenu-group"),n=t.querySelector(".modulemenu-group-container"),o="true"===e.attributes.getNamedItem("aria-expanded").value;o?m.addCollapsedMainMenuItem(e.id):m.removeCollapseMainMenuItem(e.id),t.classList.toggle("modulemenu-group-collapsed",o),t.classList.toggle("modulemenu-group-expanded",!o),e.attributes.getNamedItem("aria-expanded").value=(!o).toString(),a.default(n).stop().slideToggle()}static highlightModuleMenuItem(e){a.default(".modulemenu-action.modulemenu-action-active").removeClass("modulemenu-action-active").removeAttr("aria-current"),a.default("#"+e).addClass("modulemenu-action-active").attr("aria-current","location")}static getPreviousItem(e){let t=e.parentElement.previousElementSibling;return null===t?m.getLastItem(e):t.firstElementChild}static getNextItem(e){let t=e.parentElement.nextElementSibling;return null===t?m.getFirstItem(e):t.firstElementChild}static getFirstItem(e){return e.parentElement.parentElement.firstElementChild.firstElementChild}static getLastItem(e){return e.parentElement.parentElement.lastElementChild.firstElementChild}static getParentItem(e){return e.parentElement.parentElement.parentElement.firstElementChild}static getFirstChildItem(e){return e.nextElementSibling.firstElementChild.firstElementChild}static getLastChildItem(e){return e.nextElementSibling.lastElementChild.firstElementChild}refreshMenu(){new d(TYPO3.settings.ajaxUrls.modulemenu).get().then(async e=>{const t=await e.resolve();document.getElementById("modulemenu").outerHTML=t.menu,this.initializeModuleMenuEvents(),top.currentModuleLoaded&&m.highlightModuleMenuItem(top.currentModuleLoaded)})}reloadFrames(){i.NavigationContainer.refresh(),i.ContentContainer.refresh()}showModule(e,t,n=null){t=t||"";const a=o.getRecordFromName(e);return this.loadModuleComponents(a,t,new r("typo3.showModule",n))}initialize(){if(null===document.querySelector(".t3js-modulemenu"))return;let e=a.default.Deferred();e.resolve(),e.then(()=>{this.initializeModuleMenuEvents(),i.Topbar.Toolbar.registerEvent(()=>this.initializeTopBarEvents())})}keyboardNavigation(e,t,n=!1){const o=t.parentElement.attributes.getNamedItem("data-level").value;let a=null;switch(n&&(this.spaceKeyPressedOnCollapsible=!1),e.code){case"ArrowUp":a=m.getPreviousItem(t);break;case"ArrowDown":a=m.getNextItem(t);break;case"ArrowLeft":"1"===o&&t.classList.contains("t3js-modulemenu-collapsible")?("false"===t.attributes.getNamedItem("aria-expanded").value&&m.toggleModuleGroup(t),a=m.getLastChildItem(t)):"2"===o&&(a=m.getPreviousItem(m.getParentItem(t)));break;case"ArrowRight":"1"===o&&t.classList.contains("t3js-modulemenu-collapsible")?("false"===t.attributes.getNamedItem("aria-expanded").value&&m.toggleModuleGroup(t),a=m.getFirstChildItem(t)):"2"===o&&(a=m.getNextItem(m.getParentItem(t)));break;case"Home":a=e.ctrlKey&&"2"===o?m.getFirstItem(m.getParentItem(t)):m.getFirstItem(t);break;case"End":a=e.ctrlKey&&"2"===o?m.getLastItem(m.getParentItem(t)):m.getLastItem(t);break;case"Space":case"Enter":"1"===o&&t.classList.contains("t3js-modulemenu-collapsible")&&("Enter"===e.code&&e.preventDefault(),m.toggleModuleGroup(t),"true"===t.attributes.getNamedItem("aria-expanded").value&&(a=m.getFirstChildItem(t),"Space"===e.code&&(this.spaceKeyPressedOnCollapsible=!0)));break;case"Esc":case"Escape":"2"===o&&(a=m.getParentItem(t),m.toggleModuleGroup(a));break;default:a=null}null!==a&&(e.defaultPrevented||e.preventDefault(),a.focus())}initializeModuleMenuEvents(){const e=document.querySelector(".t3js-modulemenu"),t=function(e){"Space"===e.code&&this.spaceKeyPressedOnCollapsible&&(e.preventDefault(),this.spaceKeyPressedOnCollapsible=!1)}.bind(this);new u("keydown",this.keyboardNavigation).delegateTo(e,".t3js-modulemenu-action"),e.querySelectorAll('[data-level="2"] .t3js-modulemenu-action[data-link]').forEach(e=>{e.addEventListener("keyup",t)}),new u("keyup",(e,t)=>{"Space"===e.code&&e.preventDefault()}).delegateTo(e,".t3js-modulemenu-collapsible"),new u("click",(e,t)=>{e.preventDefault(),this.showModule(t.id,"",e)}).delegateTo(e,".t3js-modulemenu-action[data-link]"),new u("click",(e,t)=>{e.preventDefault(),m.toggleModuleGroup(t)}).delegateTo(e,".t3js-modulemenu-collapsible")}initializeTopBarEvents(){const e=document.querySelector(".t3js-scaffold-toolbar");new u("keydown",(e,t)=>{this.keyboardNavigation(e,t)}).delegateTo(e,".t3js-modulemenu-action"),new u("click",(e,t)=>{e.preventDefault(),this.showModule(t.id,"",e)}).delegateTo(e,".t3js-modulemenu-action[data-link]"),new u("click",e=>{e.preventDefault(),m.toggleMenu()}).bindTo(document.querySelector(".t3js-topbar-button-modulemenu")),new u("click",e=>{e.preventDefault(),m.toggleMenu(!0)}).bindTo(document.querySelector(".t3js-scaffold-content-overlay"));const t=e=>{const t=e.detail.module;if(!t||this.loadedModule===t)return;m.highlightModuleMenuItem(t),a.default("#"+t).focus(),this.loadedModule=t;const n=o.getRecordFromName(t);if(n.link&&(top.currentSubScript=n.link),top.currentModuleLoaded=t,n.link)if(n.navigationComponentId)i.NavigationContainer.showComponent(n.navigationComponentId);else if(n.navigationFrameScript){i.NavigationContainer.show("typo3-navigationIframe");new r("typo3.showModule",event);this.openInNavFrame(n.navigationFrameScript,n.navigationFrameScriptParam,new s("typo3.loadModuleComponents",new r("typo3.showModule",null)))}else i.NavigationContainer.hide(!1)};document.addEventListener("typo3-module-load",t),document.addEventListener("typo3-module-loaded",t)}loadModuleComponents(e,t,n){const o=e.name,l=i.ContentContainer.beforeSetUrl(n);return l.then(a.default.proxy(()=>{e.navigationComponentId?i.NavigationContainer.showComponent(e.navigationComponentId):e.navigationFrameScript?(i.NavigationContainer.show("typo3-navigationIframe"),this.openInNavFrame(e.navigationFrameScript,e.navigationFrameScriptParam,new s("typo3.loadModuleComponents",n))):i.NavigationContainer.hide(!0),m.highlightModuleMenuItem(o),this.loadedModule=o,t=m.includeId(e,t),this.openInContentContainer(o,e.link,t,new s("typo3.loadModuleComponents",n)),top.currentSubScript=e.link,top.currentModuleLoaded=o},this)),l}openInNavFrame(e,t,n){const o=e+(t?(e.includes("?")?"&":"?")+t:""),a=i.NavigationContainer.getUrl(),l=i.NavigationContainer.setUrl(e,new s("typo3.openInNavFrame",n));return a!==o&&("resolved"===l.state()?i.NavigationContainer.refresh():l.then(i.NavigationContainer.refresh)),l}openInContentContainer(e,t,n,o){let a;if(top.nextLoadModuleUrl)a=i.ContentContainer.setUrl(top.nextLoadModuleUrl,new s("typo3.openInContentFrame",o),null),top.nextLoadModuleUrl="";else{const l=t+(n?(t.includes("?")?"&":"?")+n:"");a=i.ContentContainer.setUrl(l,new s("typo3.openInContentFrame",o),e)}return a}}top.TYPO3.ModuleMenu||(top.TYPO3.ModuleMenu={App:new m});return top.TYPO3.ModuleMenu}));
\ No newline at end of file
var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};define(["require","exports","./Enum/Viewport/ScaffoldIdentifier","./Module","jquery","./Storage/Persistent","./Viewport","./Event/ClientRequest","./Event/TriggerRequest","TYPO3/CMS/Core/Ajax/AjaxRequest","TYPO3/CMS/Core/Event/RegularEvent"],(function(e,t,n,o,a,l,i,r,s,d,u){"use strict";a=__importDefault(a);class m{constructor(){this.loadedModule=null,this.spaceKeyPressedOnCollapsible=!1,a.default(()=>this.initialize())}static getCollapsedMainMenuItems(){return l.isset("modulemenu")?JSON.parse(l.get("modulemenu")):{}}static addCollapsedMainMenuItem(e){const t=m.getCollapsedMainMenuItems();t[e]=!0,l.set("modulemenu",JSON.stringify(t))}static removeCollapseMainMenuItem(e){const t=this.getCollapsedMainMenuItems();delete t[e],l.set("modulemenu",JSON.stringify(t))}static includeId(e,t){if(!e.navigationComponentId&&!e.navigationFrameScript)return t;let n="";return n="TYPO3/CMS/Backend/PageTree/PageTreeElement"===e.navigationComponentId?"web":e.name.split("_")[0],top.fsMod.recentIds[n]&&(t="id="+top.fsMod.recentIds[n]+"&"+t),t}static toggleMenu(e){const t=a.default(n.ScaffoldIdentifierEnum.scaffold);void 0===e&&(e=t.hasClass("scaffold-modulemenu-expanded")),t.toggleClass("scaffold-modulemenu-expanded",!e),e||a.default(".scaffold").removeClass("scaffold-search-expanded").removeClass("scaffold-toolbar-expanded"),l.set("BackendComponents.States.typo3-module-menu",{collapsed:e})}static toggleModuleGroup(e){const t=e.closest(".modulemenu-group"),n=t.querySelector(".modulemenu-group-container"),o="true"===e.attributes.getNamedItem("aria-expanded").value;o?m.addCollapsedMainMenuItem(e.id):m.removeCollapseMainMenuItem(e.id),t.classList.toggle("modulemenu-group-collapsed",o),t.classList.toggle("modulemenu-group-expanded",!o),e.attributes.getNamedItem("aria-expanded").value=(!o).toString(),a.default(n).stop().slideToggle()}static highlightModuleMenuItem(e){a.default(".modulemenu-action.modulemenu-action-active").removeClass("modulemenu-action-active").removeAttr("aria-current"),a.default("#"+e).addClass("modulemenu-action-active").attr("aria-current","location")}static getPreviousItem(e){let t=e.parentElement.previousElementSibling;return null===t?m.getLastItem(e):t.firstElementChild}static getNextItem(e){let t=e.parentElement.nextElementSibling;return null===t?m.getFirstItem(e):t.firstElementChild}static getFirstItem(e){return e.parentElement.parentElement.firstElementChild.firstElementChild}static getLastItem(e){return e.parentElement.parentElement.lastElementChild.firstElementChild}static getParentItem(e){return e.parentElement.parentElement.parentElement.firstElementChild}static getFirstChildItem(e){return e.nextElementSibling.firstElementChild.firstElementChild}static getLastChildItem(e){return e.nextElementSibling.lastElementChild.firstElementChild}refreshMenu(){new d(TYPO3.settings.ajaxUrls.modulemenu).get().then(async e=>{const t=await e.resolve();document.getElementById("modulemenu").outerHTML=t.menu,this.initializeModuleMenuEvents(),top.currentModuleLoaded&&m.highlightModuleMenuItem(top.currentModuleLoaded)})}reloadFrames(){i.NavigationContainer.refresh(),i.ContentContainer.refresh()}showModule(e,t,n=null){t=t||"";const a=o.getRecordFromName(e);return this.loadModuleComponents(a,t,new r("typo3.showModule",n))}initialize(){if(null===document.querySelector(".t3js-modulemenu"))return;let e=a.default.Deferred();e.resolve(),e.then(()=>{this.initializeModuleMenuEvents(),i.Topbar.Toolbar.registerEvent(()=>{document.querySelector(".t3js-scaffold-toolbar")&&this.initializeTopBarEvents()})})}keyboardNavigation(e,t,n=!1){const o=t.parentElement.attributes.getNamedItem("data-level").value;let a=null;switch(n&&(this.spaceKeyPressedOnCollapsible=!1),e.code){case"ArrowUp":a=m.getPreviousItem(t);break;case"ArrowDown":a=m.getNextItem(t);break;case"ArrowLeft":"1"===o&&t.classList.contains("t3js-modulemenu-collapsible")?("false"===t.attributes.getNamedItem("aria-expanded").value&&m.toggleModuleGroup(t),a=m.getLastChildItem(t)):"2"===o&&(a=m.getPreviousItem(m.getParentItem(t)));break;case"ArrowRight":"1"===o&&t.classList.contains("t3js-modulemenu-collapsible")?("false"===t.attributes.getNamedItem("aria-expanded").value&&m.toggleModuleGroup(t),a=m.getFirstChildItem(t)):"2"===o&&(a=m.getNextItem(m.getParentItem(t)));break;case"Home":a=e.ctrlKey&&"2"===o?m.getFirstItem(m.getParentItem(t)):m.getFirstItem(t);break;case"End":a=e.ctrlKey&&"2"===o?m.getLastItem(m.getParentItem(t)):m.getLastItem(t);break;case"Space":case"Enter":"1"===o&&t.classList.contains("t3js-modulemenu-collapsible")&&("Enter"===e.code&&e.preventDefault(),m.toggleModuleGroup(t),"true"===t.attributes.getNamedItem("aria-expanded").value&&(a=m.getFirstChildItem(t),"Space"===e.code&&(this.spaceKeyPressedOnCollapsible=!0)));break;case"Esc":case"Escape":"2"===o&&(a=m.getParentItem(t),m.toggleModuleGroup(a));break;default:a=null}null!==a&&(e.defaultPrevented||e.preventDefault(),a.focus())}initializeModuleMenuEvents(){const e=document.querySelector(".t3js-modulemenu"),t=function(e){"Space"===e.code&&this.spaceKeyPressedOnCollapsible&&(e.preventDefault(),this.spaceKeyPressedOnCollapsible=!1)}.bind(this);new u("keydown",this.keyboardNavigation).delegateTo(e,".t3js-modulemenu-action"),e.querySelectorAll('[data-level="2"] .t3js-modulemenu-action[data-link]').forEach(e=>{e.addEventListener("keyup",t)}),new u("keyup",(e,t)=>{"Space"===e.code&&e.preventDefault()}).delegateTo(e,".t3js-modulemenu-collapsible"),new u("click",(e,t)=>{e.preventDefault(),this.showModule(t.id,"",e)}).delegateTo(e,".t3js-modulemenu-action[data-link]"),new u("click",(e,t)=>{e.preventDefault(),m.toggleModuleGroup(t)}).delegateTo(e,".t3js-modulemenu-collapsible")}initializeTopBarEvents(){const e=document.querySelector(".t3js-scaffold-toolbar");new u("keydown",(e,t)=>{this.keyboardNavigation(e,t)}).delegateTo(e,".t3js-modulemenu-action"),new u("click",(e,t)=>{e.preventDefault(),this.showModule(t.id,"",e)}).delegateTo(e,".t3js-modulemenu-action[data-link]"),new u("click",e=>{e.preventDefault(),m.toggleMenu()}).bindTo(document.querySelector(".t3js-topbar-button-modulemenu")),new u("click",e=>{e.preventDefault(),m.toggleMenu(!0)}).bindTo(document.querySelector(".t3js-scaffold-content-overlay"));const t=e=>{const t=e.detail.module;if(!t||this.loadedModule===t)return;m.highlightModuleMenuItem(t),a.default("#"+t).focus(),this.loadedModule=t;const n=o.getRecordFromName(t);if(n.link&&(top.currentSubScript=n.link),top.currentModuleLoaded=t,n.link)if(n.navigationComponentId)i.NavigationContainer.showComponent(n.navigationComponentId);else if(n.navigationFrameScript){i.NavigationContainer.show("typo3-navigationIframe");new r("typo3.showModule",event);this.openInNavFrame(n.navigationFrameScript,n.navigationFrameScriptParam,new s("typo3.loadModuleComponents",new r("typo3.showModule",null)))}else i.NavigationContainer.hide(!1)};document.addEventListener("typo3-module-load",t),document.addEventListener("typo3-module-loaded",t)}loadModuleComponents(e,t,n){const o=e.name,l=i.ContentContainer.beforeSetUrl(n);return l.then(a.default.proxy(()=>{e.navigationComponentId?i.NavigationContainer.showComponent(e.navigationComponentId):e.navigationFrameScript?(i.NavigationContainer.show("typo3-navigationIframe"),this.openInNavFrame(e.navigationFrameScript,e.navigationFrameScriptParam,new s("typo3.loadModuleComponents",n))):i.NavigationContainer.hide(!0),m.highlightModuleMenuItem(o),this.loadedModule=o,t=m.includeId(e,t),this.openInContentContainer(o,e.link,t,new s("typo3.loadModuleComponents",n)),top.currentSubScript=e.link,top.currentModuleLoaded=o},this)),l}openInNavFrame(e,t,n){const o=e+(t?(e.includes("?")?"&":"?")+t:""),a=i.NavigationContainer.getUrl(),l=i.NavigationContainer.setUrl(e,new s("typo3.openInNavFrame",n));return a!==o&&("resolved"===l.state()?i.NavigationContainer.refresh():l.then(i.NavigationContainer.refresh)),l}openInContentContainer(e,t,n,o){let a;if(top.nextLoadModuleUrl)a=i.ContentContainer.setUrl(top.nextLoadModuleUrl,new s("typo3.openInContentFrame",o),null),top.nextLoadModuleUrl="";else{const l=t+(n?(t.includes("?")?"&":"?")+n:"");a=i.ContentContainer.setUrl(l,new s("typo3.openInContentFrame",o),e)}return a}}top.TYPO3.ModuleMenu||(top.TYPO3.ModuleMenu={App:new m});return top.TYPO3.ModuleMenu}));
\ No newline at end of file
......@@ -633,8 +633,8 @@ class GraphicalFunctions
if (!$this->processorEffectsEnabled) {
$command = trim($this->scalecmd . ' ' . $w . 'x' . $h . '! -negate');
} else {
$command = trim($conf['niceText.']['before'] . ' ' . $this->scalecmd . ' ' . $w . 'x' . $h . '! ' . $conf['niceText.']['after'] . ' -negate');
if ($conf['niceText.']['sharpen']) {
$command = trim(($conf['niceText.']['before'] ?? '') . ' ' . $this->scalecmd . ' ' . $w . 'x' . $h . '! ' . ($conf['niceText.']['after'] ?? '') . ' -negate');
if (isset($conf['niceText.']['sharpen'])) {
$command .= $this->v5_sharpen($conf['niceText.']['sharpen']);
}
}
......@@ -1456,7 +1456,7 @@ class GraphicalFunctions
imagedestroy($blurTextImg_tmp);
// Adjust the mask
$intensity = 40;
if ($conf['intensity']) {
if ($conf['intensity'] ?? false) {
$intensity = MathUtility::forceIntegerInRange($conf['intensity'], 0, 100);
}
$intensity = (int)ceil(255 - $intensity / 100 * 255);
......
......@@ -123,7 +123,7 @@ class ConstantConfigurationParser
}
}
$configurationOption['labels'] = GeneralUtility::trimExplode(':', $configurationOption['label'], false, 2);
$configurationOption['subcat_name'] = $configurationOption['subcat_name'] ?: '__default';
$configurationOption['subcat_name'] = ($configurationOption['subcat_name'] ?? false) ?: '__default';
$hierarchicConfiguration[$configurationOption['cat']][$configurationOption['subcat_name']][$configurationOption['name']] = $configurationOption;
return $hierarchicConfiguration;
}
......
<?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\InstallTool;
use TYPO3\CMS\Core\Tests\Acceptance\Support\BackendTester;
use TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog;
class SettingsCest extends AbstractCest
{
public static string $alertContainerSelector = '#alert-container';
public function _before(BackendTester $I)
{
parent::_before($I);
$this->logIntoInstallTool($I);
$I->click('Settings');
$I->see('Settings', 'h1');
}
/**
* @param BackendTester $I
* @param ModalDialog $modalDialog
* @throws \Exception
*/
public function seeExtensionConfiguration(BackendTester $I, ModalDialog $modalDialog)
{
$I->click('Configure extensions');
$modalDialog->canSeeDialog();
$I->amGoingTo('open the backend panel');
$I->click('backend', '.panel-heading');
$I->waitForElement('#em-backend-loginLogoAlt');
$I->amGoingTo('fill in an alt text for the logo');
$I->fillField('#em-backend-loginLogoAlt', 'TYPO3 logo alt text');
$I->click('Save "backend" configuration', ModalDialog::$openedModalSelector);
$I->waitForText('Configuration saved', 5, self::$alertContainerSelector);
$this->closeModalAndHideFlashMessage($I);
}
/**
* @param BackendTester $I
* @param ModalDialog $modalDialog
* @throws \Exception
*/
public function seeChangeInstallToolPassword(BackendTester $I, ModalDialog $modalDialog)
{
$I->click('Change Install Tool Password');
$modalDialog->canSeeDialog();
$I->amGoingTo('change the install tool password');
$I->fillField('#t3-install-tool-password', 'password');
$I->fillField('#t3-install-tool-password-repeat', 'password');
$I->click('Set new password', ModalDialog::$openedModalButtonContainerSelector);
$I->waitForText('Install tool password changed', 5, self::$alertContainerSelector);
$this->closeModalAndHideFlashMessage($I);
}
/**
* @param BackendTester $I
* @param ModalDialog $modalDialog
* @throws \Exception
*/
public function seeManageSystemMaintainers(BackendTester $I, ModalDialog $modalDialog)
{
$I->click('Manage System Maintainers');
$modalDialog->canSeeDialog();
$I->amGoingTo('add a system maintainer to the list');
$I->click('.chosen-search-input', ModalDialog::$openedModalSelector);
$I->click('.active-result[data-option-array-index="0"]', '.chosen-results');
$I->click('Save system maintainer list', ModalDialog::$openedModalButtonContainerSelector);
$I->waitForText('Updated system maintainers', 5, self::$alertContainerSelector);
$this->closeModalAndHideFlashMessage($I);
}
/**
* @param BackendTester $I
* @param ModalDialog $modalDialog
* @throws \Exception
*/
public function seeConfigurationPresets(BackendTester $I, ModalDialog $modalDialog)
{
$I->click('Choose Preset');
$modalDialog->canSeeDialog();
$I->amGoingTo('open the cache settings panel');
$I->click('Cache settings', '.panel-heading');
$I->waitForElement('#t3-install-tool-configuration-cache-file');
$I->amGoingTo('change cache configuration and save configuration');
$I->click('#t3-install-tool-configuration-cache-file');
$I->click('Activate preset', ModalDialog::$openedModalButtonContainerSelector);
$I->waitForText('Configuration written', 5, self::$alertContainerSelector);
$this->closeModalAndHideFlashMessage($I);
}
public function seeFeatureToggles(BackendTester $I, ModalDialog $modalDialog)
{
$I->click('Configure Features');
$modalDialog->canSeeDialog();
$I->amGoingTo('change a feature toggle and save it');
$I->click('#t3-install-tool-features-redirects.hitCount');
$I->click('Save', ModalDialog::$openedModalButtonContainerSelector);
$I->waitForText('Features updated', 5, self::$alertContainerSelector);
$this->closeModalAndHideFlashMessage($I);
}
/**
* @param BackendTester $I
* @param ModalDialog $modalDialog
* @throws \Exception
*/
public function seeConfigureInstallationWideOptions(BackendTester $I, ModalDialog $modalDialog)
{
$I->click('Configure options');
$modalDialog->canSeeDialog();
$I->amGoingTo('open the backend panel');
$I->click('Backend', '.panel-heading');
$I->waitForElement('#BE_languageDebug');
$I->amGoingTo('tick of checkbox the [BE][languageDebug] option');
$I->click('#BE_languageDebug');
$I->click('Write configuration', ModalDialog::$openedModalButtonContainerSelector);
$I->waitForText('BE/languageDebug', 5, self::$alertContainerSelector);
$this->closeModalAndHideFlashMessage($I);
}
/**
* @param BackendTester $I
*/
private function closeModalAndHideFlashMessage(BackendTester $I)
{
// We need to close the flash message here to be able to close the modal
$I->click('.close', self::$alertContainerSelector);
$I->click('.t3js-modal-close');
}
}
......@@ -55,7 +55,7 @@ class SendmailPreset extends AbstractPreset
{
$configurationValues = $this->configurationValues;
$configurationValues['MAIL/transport_sendmail_command'] = $this->getSendmailPath();
if ($this->postValues['Mail']['enable'] === 'Sendmail') {
if (($this->postValues['Mail']['enable'] ?? false) === 'Sendmail') {
$configurationValues['MAIL/transport'] = 'sendmail';
}
return $configurationValues;
......
......@@ -442,7 +442,7 @@ class SettingsController extends AbstractController
public function extensionConfigurationWriteAction(ServerRequestInterface $request): ResponseInterface
{
$extensionKey = $request->getParsedBody()['install']['extensionKey'];
$configuration = $request->getParsedBody()['install']['extensionConfiguration'];
$configuration = $request->getParsedBody()['install']['extensionConfiguration'] ?? [];
$nestedConfiguration = [];
foreach ($configuration as $configKey => $value) {
$nestedConfiguration = ArrayUtility::setValueByPath($nestedConfiguration, $configKey, $value, '.');
......
......@@ -91,13 +91,13 @@ class LocalConfigurationValueService
if ($descriptionType === 'container') {
$valueFromCurrentConfiguration = $sectionsFromCurrentConfiguration[$key] ?? null;
$data = array_merge($data, $this->recursiveConfigurationFetching($value, $valueFromCurrentConfiguration, $descriptionInfo, $newPath));
} elseif (!preg_match('/[' . LF . CR . ']/', (string)$value) || $descriptionType === 'multiline') {
} elseif (!preg_match('/[' . LF . CR . ']/', (string)(is_array($value) ? '' : $value)) || $descriptionType === 'multiline') {
$itemData = [];
$itemData['key'] = implode('/', $newPath);
$itemData['path'] = '[' . implode('][', $newPath) . ']';
$itemData['fieldType'] = $descriptionInfo['type'];
$itemData['description'] = $descriptionInfo['description'];
$itemData['allowedValues'] = $descriptionInfo['allowedValues'];
$itemData['description'] = $descriptionInfo['description'] ?? '';
$itemData['allowedValues'] = $descriptionInfo['allowedValues'] ?? [];
$itemData['differentValueInCurrentConfiguration'] = (!isset($descriptionInfo['compareValuesWithCurrentConfiguration']) ||
$descriptionInfo['compareValuesWithCurrentConfiguration']) &&
isset($sectionsFromCurrentConfiguration[$key]) &&
......
......@@ -182,7 +182,7 @@ class UpgradeWizardsService
}
foreach ($changedTable->addedIndexes as $addedIndex) {
/** $var Index $addedIndex */
if (!is_array($adds['indexes'])) {
if (!is_array($adds['indexes'] ?? false)) {
$adds['indexes'] = [];
}
$adds['indexes'][] = [
......
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