Integrity constraint violation when enabling/disabling Magento modules

Once i had one task which gave following error when enabled/disabled any module (System >> Configuration >> Advanced)

Exception message: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'default-0-advanced/modules_disable_output/_' for key 'config_scope'

Solutions:
First i think it may be because of dublicate entry of that module; so i was checked in "core_config_data", but i found nothing over there... there is no entry of that module in "core_config_data" table.

So i execute the following query into mysql browser:

INSERT INTO `core_config_data` (`scope`, `scope_id`, `path`, `value`) VALUES ('default', 0, 'advanced/modules_disable_output/Companyname_Modulename', 0);

but it still through that error. then i checked into "config.xml" file of that module and what i found:

There is problem of naming conversion. it is

 <modules>  
     <<companyname>_<modulename>>  
       <version>0.1.0</version>  
     </<companyname>_<modulename>>  
 </modules>  
 Insted of  
 <modules>  
     <<Companyname>_<Modulename>>  
       <version>0.1.0</version>  
     </<Companyname>_<Modulename>>  
 </modules>  

First i delete the entry which i do for module install.
I changed the capitalization in my config.xml file and check into the core_config_data table.. it added that module row with proper capitlization.
Now it works fine

Hope this will helps.

Cheers
Gaurav

Comments

Popular posts from this blog

Magento Reindexing problem - take too long time

Magento Navigation menu of CMS pages

Magento Admin login problem