0
votes

I have moved a Magento installation to a new server to do some development work. It was not me that created the original installation. The frontend works but admin has problems.

The captcha module caused an error on the login page, exactly like Stack Overflow question 25497797

I edited app/code/core/Mage/Captcha/block/Captcha.php adding return ''; at the begining of the toHTML() function so the captcha doesn't show and error never happens. The login page now loads the correctly without the captcha but the paths in links (href and src) are incorrect. There is no CSS or JS loaded.

CSS file paths start /adminhtml/blablabla instead of /skin/adminhtml/blablabla

JS file paths start /prototype/blablabla instead of /js/prototype/blablabla

Html links are not relative to the root. For example : the "Forgot your password" link on the login page is to /index.php/admin/index.php/admin/index/forgotpassword/?SID=b85555a943df9821ba2326aae2c7ab45

I have tried: - checking for permissions and file ownership problems. - deleting the cache directory - disableing the cache completely - turning off the compiler, clearing the compiler, turning the compiler back on - I have checked web/unsecure/base_url, it's correct - I have tried changing web/unsecure/base_skin_url from {{unsecure_base_url}}skin/ to something else. This has no effect.

It's as if the config settings are not being used.

I have read that it is possible to add url definitions to a config.xml file so I added this to app/etc/config.xml just inside the root node.

<stores>
  <default>
    <web>
      <unsecure>
        <base_url>{{base_url}}</base_url>
        <base_link_url>{{unsecure_base_url}}</base_link_url>
        <base_web_url>{{unsecure_base_url}}</base_web_url>
        <base_skin_url>{{unsecure_base_url}}skin/</base_skin_url>
        <base_js_url>{{unsecure_base_url}}js/</base_js_url>
        <base_media_url>{{unsecure_base_url}}media/</base_media_url>
      </unsecure>
      <secure>
        <base_url>{{base_url}}</base_url>
        <base_web_url>{{secure_base_url}}</base_web_url>
        <base_link_url>{{secure_base_url}}</base_link_url>
        <base_js_url>{{secure_base_url}}js/</base_js_url>
        <base_skin_url>{{secure_base_url}}skin/</base_skin_url>
        <base_media_url>{{secure_base_url}}media/</base_media_url>
      </secure>
    </web>
  </default>
</stores>

No effect here either. Have I put it in the right place?

I have run out of ideas. Can anyone suggest anything else? It's a development server so I can play with core files to echo print_r things.

Any help will be much apreciated.

1

1 Answers

1
votes

This worked:

SET FOREIGN_KEY_CHECKS=0;
UPDATE `core_store` SET store_id = 0 WHERE code='admin';
UPDATE `core_store_group` SET group_id = 0 WHERE name='Default';
UPDATE `core_website` SET website_id = 0 WHERE code='admin';
UPDATE `customer_group` SET customer_group_id = 0 WHERE customer_group_code='NOT LOGGED IN';
SET FOREIGN_KEY_CHECKS=1;