2

I recently patched a 1.6 site with SUPEE-9767, on our development copy I encountered no issues, but after I pushed it onto the live host I could no longer get into the admin area.

I would get the following redirects:

/admin (302) -> /index.php/admin
/index.php/admin (302) -> /

I've flushed the cache, rebuilt the indexes, and confirmed that the file perms are correct but still the same behaviour.

It feels like I'm overlooking something.

  • try to access admin through yoursite.com/dowloader once in the dowloader at the top you will see an option to go back to Admin Panel. Click that. – Icon Jun 8 '17 at 3:11
3

I've literally just spent most of my afternoon debugging this issue. The issue only occurs when https is enabled (which might explain why it doesn't occur in your dev environment).

Line 835 of PATCH_SUPEE-9767_CE_1.6.2.0_v1-2017-05-25-09-32-57.sh makes this change to _checkBaseUrl in app/code/core/Mage/Core/Controller/Varien/Front.php:

-        $baseUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB, Mage::app()->getStore()->isCurrentlySecure());
-
+        $baseUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB,
+            Mage::getConfig()->shouldUrlBeSecure($request->getPathInfo())
+        );

The issue is that shouldUrlBeSecure returns false because the admin frontname is not on the list of secure URLs. That causes Mage::getBaseUrl to return the unsecure base_url, and subsequent comparison with the current URL to fail (different protocol/scheme). Therefore Magento will redirect you to the base_url (i.e. the redirect to the http home page behaviour you're seeing).

I hate core hacks as a fix, but undoing the effect of that patch at line 317 of app/code/core/Mage/Core/Controller/Varien/Front.php seems to be the best option.

Cue Ben Marks... Did you just edit the core?

|improve this answer|||||
  • Note SUPEE-9767 for other versions of Magento 1.x don't include this change, so I'm puzzled as to why it's there for 1.6, – Jim OHalloran Jun 8 '17 at 7:10
0

Definitely not. Put it in app\code\local\Mage\Core\Controller\Varien

I just tested and it worked like that

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.