Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Already installed, but getting this error
 
jmayer
Jr. Member
 
Total Posts:  21
Joined:  2007-09-03
 

Site was working just fine, then a few days later I am getting this error:

Please advise. Appreciate the help. Underneath the errors the site is running up to a point.

NoticeUndefined index:  code in /mnt/target02/342975/343553/www.mywebsite.com/web/content/app/code/core/Mage/Core/Model/Mysql4/Config.php on line 136
[0] in Mage_Core_Model_Mysql4_Config
->loadToXml(Mage_Core_Model_Configin /mnt/target02/342975/343553/www.mywebsite.com/web/content/app/code/core/Mage/Core/Model/Config.php on line 140
[1] in Mage_Core_Model_Config
->init(NULLin /mnt/target02/342975/343553/www.mywebsite.com/web/content/app/code/core/Mage/Core/Model/App.php on line 126
[2] in Mage_Core_Model_App
->init("base"NULLin /mnt/target02/342975/343553/www.mywebsite.com/web/content/app/Mage.php on line 359
[3] in Mage
::app("base"NULLin /mnt/target02/342975/343553/www.mywebsite.com/web/content/app/Mage.php on line 379
[4] in Mage
::run("base"in /mnt/target02/342975/343553/www.mywebsite.com/web/content/index.php on line 28

Notice
Undefined index:  code in /mnt/target02/342975/343553/www.mywebsite.com/web/content/app/code/core/Mage/Core/Model/Mysql4/Config.php on line 136
[0] in Mage_Core_Model_Mysql4_Config
->loadToXml(Mage_Core_Model_Configin /mnt/target02/342975/343553/www.mywebsite.com/web/content/app/code/core/Mage/Core/Model/Config.php on line 140
[1] in Mage_Core_Model_Config
->init(NULLin /mnt/target02/342975/343553/www.mywebsite.com/web/content/app/code/core/Mage/Core/Model/App.php on line 126
[2] in Mage_Core_Model_App
->init("base"NULLin /mnt/target02/342975/343553/www.mywebsite.com/web/content/app/Mage.php on line 359
[3] in Mage
::app("base"NULLin /mnt/target02/342975/343553/www.mywebsite.com/web/content/app/Mage.php on line 379
[4] in Mage
::run("base"in /mnt/target02/342975/343553/www.mywebsite.com/web/content/index.php on line 28

Notice
Undefined index:  code in /mnt/target02/342975/343553/www.mywebsite.com/web/content/app/code/core/Mage/Core/Model/Mysql4/Config.php on line 136
[0] in Mage_Core_Model_Mysql4_Config
->loadToXml(Mage_Core_Model_Configin /mnt/target02/342975/343553/www.mywebsite.com/web/content/app/code/core/Mage/Core/Model/Config.php on line 140
[1] in Mage_Core_Model_Config
->init(NULLin /mnt/target02/342975/343553/www.mywebsite.com/web/content/app/code/core/Mage/Core/Model/App.php on line 126
[2] in Mage_Core_Model_App
->init("base"NULLin /mnt/target02/342975/343553/www.mywebsite.com/web/content/app/Mage.php on line 359
[3] in Mage
::app("base"NULLin /mnt/target02/342975/343553/www.mywebsite.com/web/content/app/Mage.php on line 379
[4] in Mage
::run("base"in /mnt/target02/342975/343553/www.mywebsite.com/web/content/index.php on line 28
 
Magento Community Magento Community
Magento Community
Magento Community
 
Michael_1
Enthusiast
 
Total Posts:  826
Joined:  2007-08-31
 

Hi jmayer,

You can try to refresh all the caches at System -> Cache Management and check your stores to make sure that all of them have ‘Store Code’ set.

Could please post here what does the following query return ?

SELECT FROM `core_store`;

Thank you.

 
Magento Community Magento Community
Magento Community
Magento Community
 
jeanlucb
Member
 
Total Posts:  60
Joined:  2008-02-10
 

here is what i got…

store_id code website_id group_id name sort_order is_active
1 default 1 1 Custom Restaurant Accessories 0 1
2 admin 0 0 Admin 0 1

 
Magento Community Magento Community
Magento Community
Magento Community
 
Michael_1
Enthusiast
 
Total Posts:  826
Joined:  2007-08-31
 
jeanlucb - 03 June 2008 01:31 PM

here is what i got…

store_id code website_id group_id name sort_order is_active
1 default 1 1 Custom Restaurant Accessories 0 1
2 admin 0 0 Admin 0 1

That is definitely wrong as admin should have store_id 0.
It seems like the database was backed up and then restored without taking care of the NO_AUTO_VALUE_ON_ZERO flag.

What software did you use to backup/restore the database ?
Both command line mysqldump and phpMyAdmin do care of this properly by adding the following line at the beginning of the dump file:

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
 
Magento Community Magento Community
Magento Community
Magento Community
 
jeanlucb
Member
 
Total Posts:  60
Joined:  2008-02-10
 

it work !!

I added this on top in my dumpfile

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

 
Magento Community Magento Community
Magento Community
Magento Community
 
jeanlucb
Member
 
Total Posts:  60
Joined:  2008-02-10
 

micheal, thanks by the way wink

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top