We are having a log build up of errors starting with the title error:
2017年07月12日T16:32:09+00:00 ERR (3): Warning: Invalid argument supplied for foreach() in /chroot/home/apollode/apollooutlet.com/html/app/code/local/Mage/Core/Model/Config.php on line 870
2017年07月12日T16:32:10+00:00 ERR (3): Notice: Undefined index: Enterprise_Search in /chroot/home/apollode/apollooutlet.com/html/app/code/local/Mage/Core/Model/Config.php on line 851
2017年07月12日T16:32:10+00:00 ERR (3): Warning: array_merge(): Argument #2 is not an array in /chroot/home/apollode/apollooutlet.com/html/app/code/local/Mage/Core/Model/Config.php on line 851
2017年07月12日T16:32:10+00:00 ERR (3): Warning: array_merge(): Argument #1 is not an array in /chroot/home/apollode/apollooutlet.com/html/app/code/local/Mage/Core/Model/Config.php on line 851
Looking in the Config.php file at 870 returns this code
protected function _sortModuleDepends($modules)
{
foreach ($modules as $moduleName => $moduleProps) {
$depends = $moduleProps['depends'];
foreach ($moduleProps['depends'] as $depend => $true) {
if ($moduleProps['active'] && ((!isset($modules[$depend])) || empty($modules[$depend]['active']))) {
Mage::throwException(
Mage::helper('core')->__('Module "%1$s" requires module "%2$s".', $moduleName, $depend)
);
}
$depends = array_merge($depends, $modules[$depend]['depends']);
}
$modules[$moduleName]['depends'] = $depends;
}
$modules = array_values($modules);
$size = count($modules) - 1;
for ($i = $size; $i >= 0; $i--) {
for ($j = $size; $i < $j; $j--) {
if (isset($modules[$i]['depends'][$modules[$j]['module']])) {
$value = $modules[$i];
$modules[$i] = $modules[$j];
$modules[$j] = $value;
}
}
}
$definedModules = array();
foreach ($modules as $moduleProp) {
foreach ($moduleProp['depends'] as $dependModule => $true) {
if (!isset($definedModules[$dependModule])) {
Mage::throwException(
Mage::helper('core')->__('Module "%1$s" cannot depend on "%2$s".', $moduleProp['module'], $dependModule)
);
}
}
$definedModules[$moduleProp['module']] = true;
}
What could be causing this issue? Is this a known issue with Magento? Please help.
1 Answer 1
I've taken a look at the code in question and indeed this looks like an issue with Magento, but it only occurs on a specific edge case:
- Module X requires another module Y
- Module Y is not installed
- Module X is not active
Since you usually do not install modules that require other modules without those other modules, and the site does not crash, only logs errors, this bug has been undiscovered yet (or not cared about enough).
You will find, that you have an extension with a file in app/etc/modules like this:
<modules>
<XXX>
<active>false</active>
<codePool>community</codePool>
<depends>
<Enterprise_Search />
</depends>
</XXX>
</modules>
Remove that file, or the entire module if possible. It requires the Magento Enterprise Edition, which you apparently do not have.
-
Thank you so much for the feedback I am going to be deleting it and I'll check back to tell you if it worked or not.neurosis– neurosis2017年07月13日 13:29:57 +00:00Commented Jul 13, 2017 at 13:29
-
Edit: I found the offending module in the specified file path under 'Php4u_BlastLuceneSearchEE.xml' . Thanks again.neurosis– neurosis2017年07月13日 13:44:08 +00:00Commented Jul 13, 2017 at 13:44
-
@neurosis Please accept Fabians answer to close this :)sv3n– sv3n2017年07月16日 22:19:59 +00:00Commented Jul 16, 2017 at 22:19
magento-1.8because that's the latest version that matches your code. Feel free to update