amitmodak89 / magento-w2p

Automatically exported from code.google.com/p/magento-w2p
0 stars 0 forks source link

Hard coded table names #459

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
After installing ZetaPrints_Fixedprices extension you may be faced with a MYSQL 
error like: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or 
update a
child row: a foreign key constraint fails

This probably happens because you have used custom prefix for you magento 
database installation.

We are aware of the problem, and solution for it is to modify some of the 
installation files to use dynamic table names instead of hard coded.

File to modify is 
/app/code/community/ZetaPrints/Fixedprices/sql/fixedprices_setup/mysql4-upgrade-
0.1.0-0.2.php

There on line 46 replace 
REFERENCES `core_website`
with 
REFERENCES {$this->getTable('core_website')}

And on next line replace
REFERENCES `catalog_product_entity` 
with
REFERENCES {$this->getTable('catalog_product_entity')} 

This way any custom prefix will be taken into account and correct table names 
will be used.

Original issue reported on code.google.com by jamb...@gmail.com on 14 Feb 2011 at 8:20

GoogleCodeExporter commented 8 years ago
Please, include it in the next commit.
Not sure how we can test it.
I guess it's OK as long it works on a default install and no one complains 
later.

Original comment by zetapri...@gmail.com on 14 Feb 2011 at 8:24

GoogleCodeExporter commented 8 years ago
This has been changed in latest release 0.3.5b
r1428

Original comment by jamb...@gmail.com on 7 Mar 2011 at 2:13

GoogleCodeExporter commented 8 years ago

Original comment by zetapri...@gmail.com on 4 Apr 2011 at 9:06

GoogleCodeExporter commented 8 years ago
Hard coded names were removed from the code. Names of tables are got by a 
special functions.

Original comment by Anatoly....@gmail.com on 4 Apr 2011 at 9:21

GoogleCodeExporter commented 8 years ago

Original comment by zetapri...@gmail.com on 4 Apr 2011 at 10:35