Subscribe To RSS Feed


Mike D's SharpBlog

Just another Sharpdot weblog

Posts Tagged ‘errors’

Magento: error message – Notice: Undefined index: 0 app/code/core/Mage/Core/Model/Mysql4/Config.php on line 92

- Tuesday, March 17th, 2009 -

The Quick resolution to this problem it to move the database command line, and not use phpmyadmin. If you just need to fix your database keep reading.

I was moving a installation to a production server and was getting this error message: Notice: Undefined index: 0 in app/code/core/Mage/Core/Model/Mysql4/Config.php on line 92. It took alot of searching to figure out the problem, but here is what I found. When Magento installs it sets store and website ids in the database. When transferring the database the new database did not like having an id of 0 for the admin part of the site, so it made it have an id of 2. This is what my problem was. To fix it I went into the core_store and core_website Tables and gave the admin site an id of 0. It looks like this may only affect certain versions of magento(Earlier versions). Hope this helps someone else.

P.S. I also got foreign_key_constraint errors when importing my database. To solve this disable foreign key check when you export your database. Then when you need to change the core_store and core_website id’s you will probably need to surround your sql with the following code:

set foreign_key_checks=0;
//SQL to update ids
SET FOREIGN_KEY_CHECKS=1;

Tags: , ,
Posted in magento | 35 Comments »

Magento: Error – SimpleXMLElement::addAttribute() Attribute already exists

- Tuesday, March 10th, 2009 -

Warning: SimpleXMLElement::addAttribute() [simplexmlelement.addattribute]: Attribute already exists.

This Magento Error Message was giving me the hardest time. It seems to occur when you have a mis-match in your layout files.

What happend to me was I hard coded the newsletter into a page. In the newsletter layour file It was instructed to put the newsletter in the page also. This meant that it was included in the page more than once. That is why the error is thrown. Check your layout files to get a better grip on the problem.

I need to give thanks to Branko Ajzele for his post. It helped me realize what the problem was.

Tags: ,
Posted in magento | 3 Comments »

Magento 1.2.1 – Can’t Login Error

- Tuesday, February 10th, 2009 -

It seems that things have changed in magento for the 1.2.1 version. I tried to set-up this version locally using a host name like ‘localmagento’ and prior to this version this worked just fine. Now it seems that magento 1.2.1 needs/wants a full domain name. If you set it up like this (localmagento.com) it should work just fine.

- Intrested in a magento e-commerce site? We can do that. Drop us a line.

Tags: ,
Posted in magento | 1 Comment »