Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Fatal error after deleting one store
 
All Bijoux
Jr. Member
 
Total Posts:  22
Joined:  2008-05-04
 

After deleting one store, I received a fatal error. I uninstalled magento and reinstalled refering the same database, but stil error!!

http://allbijoux.com/shop/report/?id=-248632403&s;=default

Recoverable Error: Argument 1 passed to Mage_Core_Model_Store::setGroup() must be an instance of Mage_Core_Model_Store_Group, null given, called in /home/allbijou/domains/allbijoux.com/public_html/shop/app/code/core/Mage/Core/Model/App.php on line 351 and defined in /home/allbijou/domains/allbijoux.com/public_html/shop/app/code/core/Mage/Core/Model/Store.php on line 627
Trace:
#0 /home/allbijou/domains/allbijoux.com/public_html/shop/app/code/core/Mage/Core/Model/Store.php(627): mageCoreErrorHandler(4096, ‘Argument 1 pass...’, ‘/home/allbijou/...’, 627, Array)
#1 /home/allbijou/domains/allbijoux.com/public_html/shop/app/code/core/Mage/Core/Model/App.php(351): Mage_Core_Model_Store->setGroup(NULL)
#2 /home/allbijou/domains/allbijoux.com/public_html/shop/app/code/core/Mage/Core/Model/App.php(211): Mage_Core_Model_App->_initStores()
#3 /home/allbijou/domains/allbijoux.com/public_html/shop/app/Mage.php(404): Mage_Core_Model_App->init(’’, ‘store’, Array)
#4 /home/allbijou/domains/allbijoux.com/public_html/shop/app/Mage.php(423): Mage::app(’’, ‘store’, Array)
#5 /home/allbijou/domains/allbijoux.com/public_html/shop/index.php(40): Mage::run()
#6 {main}

uaaaaa

 
Magento Community Magento Community
Magento Community
Magento Community
 
Appmerce
Guru
 
Avatar
Total Posts:  376
Joined:  2008-05-13
Amsterdam, The Netherlands
 

I had the same problem.

I you look at /app/code/core/Core/Model/Store.php, then remove that function which starts on line 627. It is a duplicate function! The correct one is below it. After removing, my site worked again.

Hope this helps.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ally
Jr. Member
 
Total Posts:  18
Joined:  2008-05-22
 

The actual directory structure to modify is:
app/code/core/Mage/Core/Model/Store.php on line 627

The function to delete (or comment out as I did) is:
public function setGroup(Mage_Core_Model_Store_Group $group)
{
$this->_group = $group;
}

But this alone did not fix my problem. I think this is a bug that when you delete the store, it doesn’t reset the default store. I had to go into the database on the server and manually change the Main Website to default:

1. Core_website table:
website_id:1
code: base
name: Main Website
sort_order: 1
default_group_id:1
is_default: 1

2. Core_Store_Group table:
group_id: 1
website_id:1
name: Main Website Store
root category_id:2
default_store_id: 1

3. Core_store table:
store_id: 1
code: default
website_id:1
group_id: 1
name: Default Store View
sort_order:1
is_active:1

 
Magento Community Magento Community
Magento Community
Magento Community
 
WebMonkey
Jr. Member
 
Total Posts:  27
Joined:  2008-06-05
 
ally - 04 June 2008 07:05 PM

The actual directory structure to modify is:
app/code/core/Mage/Core/Model/Store.php on line 627

The function to delete (or comment out as I did) is:
public function setGroup(Mage_Core_Model_Store_Group $group)
{
$this->_group = $group;
}

This fixed my problem… but I don’t understand how on earth removing a function should fix what should surely be a data problem? ... does the code to delete a store edit the .php files??

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top