Open amenk opened 11 years ago
Actually the original error message is "A page URL key for specified store already exists." - I just added more info to find out what's going on. But in fact, these seems to come from Magento core code...
This can happen if you try to merge data from two systems with different IDs for a page with the same identifier (i.e. "home"). I experienced this too once. Could this be your problem too? At the moment, you should start from the same database for all shops. Any ideas on how to make this more robust? We have discussed getting rid of the need to use entity_ids for import, but can't see how to get around that (especially for content types like blocks and email templates which can be referenced by id)
I got this when checking on only one system. I am not sure if I did export or import first. But it was a almost clean Magento install. Have to check this with a completely clean Magento install again.
I can reproduce the issue in the current master, on a completely clean magento 1.7.0.2 with sample data, installed by n98-magerun.
First command after installation: php contentsync.php export
The problem is that I have a page "home" for store 0 which is disabled and another one for the stores which is enabled. This is valid (I just can not enable the other "home" page in the backend)
Ah, thanks for the info, that clarifies things.
There is a workaround: Save both of those coexisting CMS home pages once - then it exports data. I am not 100% sure if my Magento installation is valid and if this is really a content sync bug.
Somehow it is a magento bug :-)
Mage_Cms_Model_Resource_Page::getIsUniquePageToStores
public function getIsUniquePageToStores(Mage_Core_Model_Abstract $object) { if (Mage::app()->isSingleStoreMode() || !$object->hasStores()) { $stores = array(Mage_Core_Model_App::ADMIN_STORE_ID); } else { $stores = (array)$object->getData('stores'); }
When contentsync saves the CMS page (in order to update the hash), $_data['stores'] is not set. When saving the CMS page from the admin interface, I think this comes from the admin form. So I think in my "special" (or not so special?) database constellation, I would guess that it is not possible to save this CMS page at all.
The question is if contentsync should work around that by filling the stores array from $_data['store_id']
I am getting this error:
Error: A page URL key "home" (id 2) for specified store already exists..
It is pretty much the standard Magento demo data.