3

We are having a log build up of errors starting with the title error:

2017-07-12T16: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-12T16: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-12T16: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-12T16: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.

  • To avoid confusion, I've tagged your question with magento-1.8 because that's the latest version that matches your code. Feel free to update – Fabian Schmengler Jul 12 '17 at 20:54
3

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:

  1. Module X requires another module Y
  2. Module Y is not installed
  3. 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 Jul 13 '17 at 13:29
  • Edit: I found the offending module in the specified file path under 'Php4u_BlastLuceneSearchEE.xml' . Thanks again. – neurosis Jul 13 '17 at 13:44
  • @neurosis Please accept Fabians answer to close this :) – sv3n Jul 16 '17 at 22:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.