My store returns no code id and breaks 404 error. Magento

Posted by numerical25 on Stack Overflow See other posts from Stack Overflow or by numerical25
Published on 2011-09-12T15:40:28Z Indexed on 2012/09/16 21:38 UTC
Read the original article Hit count: 170

Filed under:
|
|

I know what the issue is but I dont know how to fix it. I just migrated my magento store locally and I guess possibly some data may have been lost when transferring the DB. the DB is very large. Anyhow, when I login to my admin page, I get a 404 error, page was not found.

I debugged the issue and got down to the wire. The exception is thrown in Mage/Core/Model/App.php. Line 759 to be exacted. The following is a snippet.

Mage/Core/Model/App.php

    if (empty($this->_stores[$id])) {
        $store = Mage::getModel('core/store');
        /* @var $store Mage_Core_Model_Store */
        if (is_numeric($id)) {
            $store->load($id); // THIS ID IS FROM Mage_Core_Model_App::ADMIN_STORE_ID and its empty which causes the error
        } elseif (is_string($id)) {
            $store->load($id, 'code');
        }

        if (!$store->getCode()) { // RETURNS FALSE HERE BECAUSE NO ID Specified
            $this->throwStoreException();
        }
        $this->_stores[$store->getStoreId()] = $store;
        $this->_stores[$store->getCode()] = $store;
    }

The store returns null because $id is null so it therefore does not load any model which explains why it returns false when calling getCode()

enter image description here

[EDIT] If you want clarification, please ask for more before voting my post down. Remember I am still trying to get help not get neglected.

I am using Version 1.4.1.1. When I type in the URL for admin, I get a 404 page. I walked through the code thouroughly and found that the Model MAGE_CORE_MODEL_STORE::getCode(); Returns Null which triggers the exception. and ends the script. I do not have any other detail. I further troubleshooted the issue by checking the database and that is what the screen shot is. Showing that there is infact data in the Code Colunn.

So my question is why is the Model returning a empty column when the column clearly has a value. What can I do to further troubleshoot and figure out why its not working

[EDIT UPDATE NEW]

I did some research. the reason its returning NULL is because the store ID is null being passed

Mage::getStoreConfigFlag('web/secure/use_in_adminhtml', Mage_Core_Model_App::ADMIN_STORE_ID); // THIS IS THE ID being specified

Mage_Core_Model_App::ADMIN_STORE_ID has no value in it, so this method throws the exception. Not sure why how to fix this.

© Stack Overflow or respective owner

Related posts about php

Related posts about zend-framework