0

Notice: Undefined index: files in app\code\core\Mage\Core\Model\Translate.php on line 138 2016-04-01T11:11:23+00:00 ERR (3): Warning: Invalid argument supplied for foreach() in app\code\core\Mage\Core\Model\Translate.php on line 216

Line : 138

foreach ($this->getModulesConfig() as $moduleName=>$info) {
            $info = $info->asArray();
            $this->_loadModuleTranslation($moduleName, $info['files'], $forceReload);
        }

Line:216

protected function _loadModuleTranslation($moduleName, $files, $forceReload=false)
    {
        foreach ($files as $file) {
            $file = $this->_getModuleFilePath($moduleName, $file);
            $this->_addData($this->_getFileData($file), $moduleName, $forceReload);
        }
        return $this;
    }

It automatically create i don't know why

1 Answer 1

2

Here is the problem, one of your module declares translation files in its config.xml like this:

    <translate>
        <modules>
            <Vendor_Module>
                <files>
                    <default>Vendor_Module.csv</default>
                </files>
            </Vendor_Module>
        </modules>
    </translate>

But the <files> tag seems to be missing.

To find the module causing the problem, you can add the following code in the _loadModuleTranslation method:

Mage::log($moduleName);

Right before

foreach ($files as $file) { 

Once you've found out the module causing the problem, check the config.xml file and fix the way the translation file is declared.

4
  • Sorry i am not getting
    – Magento 2
    Apr 5, 2016 at 13:13
  • @Kothari what are you not getting ? Apr 5, 2016 at 13:14
  • What mistake i done
    – Magento 2
    Apr 5, 2016 at 13:14
  • @Kothari well I just told you in my answer. One of the modules installed on your website is declaring translation files but the <files> tag is missing. Use the code I pasted to find which module and if you don't find the error, paste the config.xml in your OP Apr 5, 2016 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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