Skip to content

Commit

Permalink
Merge pull request #614 from albig/fix-613
Browse files Browse the repository at this point in the history
Check for extension configuration before access.
  • Loading branch information
Alexander Bigga committed May 7, 2021
2 parents 497d15e + 9797729 commit 72a27b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
5 changes: 4 additions & 1 deletion Classes/Common/AbstractModule.php
Expand Up @@ -132,7 +132,10 @@ protected function printContent()
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);
}
}
13 changes: 5 additions & 8 deletions Classes/Common/AbstractPlugin.php
Expand Up @@ -113,14 +113,11 @@ protected function init(array $conf)
$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.
Expand Down

0 comments on commit 72a27b9

Please sign in to comment.