Top Nav

Archive | Magento

Determine Magento Commerce Version

While urgently patching dozens of Magento Commerce installations for the latest security alert, I needed a quick way to determine the version without logging into the admin.

I found the answer in a note on the bottom of this wiki page:

http://www.magentocommerce.com/wiki/groups/227/check_magento_version

Just open app/Mage.php and look for the getVersionInfo() function. You’ll see something like this:

Here’s a Perl one liner to extract the version:

Thanks to Peteris Krumins for a great blog full of Perl one-liners. The one above
was derived from this article:

http://www.catonmat.net/blog/perl-one-liners-explained-part-six/

BTW … here’s the security alert:

http://www.magentocommerce.com/blog/comments/important-security-update-zend-platform-vulnerability/

If you’ve not already patched then you should really get it done right away or contact Reliable Penguin for assistance.

0

Magento Upgade Notes

Here are some useful notes for upgrading Magento:

  • Before starting the upgrade, block all access to the site by turning on password protection. It is critical that only one browser execute the database upgrade.
  • Next make a full backup of all files and the database. If the upgrade fails you’ll need these to restore.
  • Using the command line seems to give the most stable results. Here’s a great article that shows the command line upgrade process:
    http://blog.nexcess.net/2011/03/11/upgrading-to-magento-1-5-0-1/
  • In the above instructions, if Step 2 fails then try running:

    Then try Step 2 again.

  • After the upgrade you’ll need to rebuild indexes and clear caches before products will display.
  • If you get an exception like this:

    Then use the fix described here:

    http://screencastworld.com/2010/07/magento/how-to-fix/php-fatal-error-call-to-a-member-function-tohtml-on-a-non-object-in-layout-php-on-line-529

  • If you get an exception like this:

    Then follow these steps:

    1. Create folder at app/code/local/Mage/Core/Block/
    2. Copy app/code/core/Mage/Core/Block/Template.php to app/code/local/Mage/Core/Block/Template.php
    3. Edit app/code/local/Mage/Core/Block/Template.php and paste this code:

      directly after this existing code:

    This fix comes from here:

    http://www.magentocommerce.com/boards/viewthread/201998/

  • Sometimes pagination will be lost from categories that span multiple pages. This can be fixed with the following steps:

    1. Edit app/design/frontend/default/modern/layout/catalog.xml
    2. Add this line:

      after this line:

      in the “Catalog default layout” section. Also add the same line after:

      in the “Category layer navigation layout” section.
    3. Edit app/design/frontend/default/modern/template/catalog/product/list/toolbar.phtml
    4. Remove these lines:

      And replace with this line:

    5. Next edit skin/frontend/default/modern/css/boxes.css.
    6. Change the “table.pager td” definition around line 443 to:
    7. After the following lines around line 450:

      Add these lines:
    8. Locate the “.a-right” definition around line 1447 and change to:

    Note that the CSS changes in steps 5 to 8 may vary between sites and different layouts.

  • The Credit Card checkout method may be broken due to a missing javascript file reference. The symptom is that the Continue button on step file does nothing. The fix is to edit the layout/page.xml file for your theme at app/design/frontend/default/[YourThemeName]/layout/page.xml and add the following line in two places:

    Full details can be found in this article:

    http://www.magthemes.com/magento-blog/checkout-does-not-work-with-credit-card-payment-method-in-magento-1-4-1-0/

    Don’t forget to flush the JavaScript/CSS Cache after making these changes.

  • While the database upgrade is running, if you get an exception like this:

    Then you’ll need to manually clear the caches like this:

    The same fix applies if you get an exception like:

  • If you get SQL integrity constrain violation errors similar to this:

    Then first try to Google and find a solution. As a last resort edit app/etc/config.xml and change:

    to:

    This will disable integrity checking. Make sure you remove this change after the upgrade has been completed.

  • Sometimes in an old theme you’ll see where the developer hacked an addJs2 function into app/code/core/Mage/Page/Block/Html/Head.php and then put something like:

    into the page.xml layout.

    To fix this change the page.xml code to:

  • In older versions you could do this in a template:

    For newer versions do this instead:

1