When I opened my site I had a
Fatal error: Uncaught TypeError: Argument 1 passed to
Mage_Core_Model_Store::setWebsite() must be an instance of
Mage_Core_Model_Website, null given, called in
/var/www/hosts/mage-composer/src/app/code/core/Mage/Core/Model/App.php
on line 645 and defined in
/var/www/hosts/mage-composer/src/app/code/core/Mage/Core/Model/Store.php
on line 453 ( ! ) TypeError: Argument 1 passed to
Mage_Core_Model_Store::setWebsite() must be an instance of
Mage_Core_Model_Website, null given, called in
/var/www/hosts/mage-composer/src/app/code/core/Mage/Core/Model/App.php
on line 645 in
/var/www/hosts/mage-composer/src/app/code/core/Mage/Core/Model/Store.php
on line 453
I opened my database and in core_store
I saw
but but the admin must have id = 0. I tried
update core_store
set `store_id` = 0
where `website_id` = 0
but it's id(ai), and I had error
Error Code: 1452. Cannot add or update a child row: a foreign key constraint fails (`usatravel`.`label_core_store`, CONSTRAINT `FK_LABEL_CORE_STORE_WEBSITE_ID_LABEL_CORE_WEBSITE_WEBSITE_ID` FOREIGN KEY (`website_id`) REFERENCES `label_core_website` (`website_id`) ON DELETE CA)
how I can fix it? Thanks in advance
Best Answer