Merge pull request #614 from albig/fix-613

Check for extension configuration before access.
This commit is contained in:
Alexander Bigga 2021-05-07 12:27:17 +02:00 committed by GitHub
commit 72a27b9def
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

View File

@ -132,7 +132,10 @@ abstract class AbstractModule extends \TYPO3\CMS\Backend\Module\BaseScriptClass
public function __construct()
{
$GLOBALS['LANG']->includeLLFile('EXT:' . $this->extKey . '/Resources/Private/Language/' . Helper::getUnqualifiedClassName(get_class($this)) . '.xml');
$this->conf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get($this->extKey);
// Read extension configuration.
if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][$this->extKey]) && is_array($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][$this->extKey])) {
$this->conf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get($this->extKey);
}
$this->data = GeneralUtility::_GPmerged($this->prefixId);
}
}

View File

@ -113,14 +113,11 @@ abstract class AbstractPlugin extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
$conf = Helper::mergeRecursiveWithOverrule($generalConf, $conf);
}
// Read extension configuration.
$extConf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get($this->extKey);
if (is_array($extConf)) {
$conf = Helper::mergeRecursiveWithOverrule($extConf, $conf);
}
// Read TYPO3_CONF_VARS configuration.
$varsConf = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey];
if (is_array($varsConf)) {
$conf = Helper::mergeRecursiveWithOverrule($varsConf, $conf);
if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][$this->extKey]) && is_array($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][$this->extKey])) {
$extConf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get($this->extKey);
if (is_array($extConf)) {
$conf = Helper::mergeRecursiveWithOverrule($extConf, $conf);
}
}
$this->conf = $conf;
// Set default plugin variables.