Resolving Fatal Errors After Upgrading Magento Community Edition
After updating your Magento installation, encountering fatal errors is a common issue that can disrupt both front-end and back-end functionality. In this post, we’ll address the specific errors you’re facing after migrating from version 1.7 to 1.9 via Magento Connect Manager.
Understanding the Fatal Errors
The first fatal error occurs due to an undefined method call in the PayPal BML module:
Fatal error: Call to undefined method Mage_Paypal_Model_Config::getBmlPublisherId() in /home/sinks/public_html/app/code/core/Mage/Paypal/Block/Bml/Banners.php on line 75
This suggests that the Mage_Paypal_Model_Config class does not contain a method called getBmlPublisherId(). The error likely stems from an incompatibility between your existing PayPal extensions and the upgraded core files.
The second fatal error is related to the Tax module:
Fatal error: Undefined class constant 'XML_PATH_TAX_NOTIFICATION_URL' in /home/sinks/public_html/app/code/core/Mage/Tax/Block/Adminhtml/Notifications.php on line 175
Here, an undefined class constant XML_PATH_TAX_NOTIFICATION_URL is being referenced by the Tax module. This could be due to missing configuration entries or changes introduced in version 1.9.
Diagnosing and Resolving the Issues
Step 1: Cleaning the Cache
Before proceeding with any major actions, ensure you have cleaned all cache files:
rm -rf var/cache/*
After running this command, check if the errors persist.
Step 2: Checking for Incompatible Extensions
In most cases, updating Magento core without reviewing and updating compatible third-party extensions can lead to such issues. Check your current list of installed modules (System > Configuration > Advanced > Disable Modules Output) and compare it with the official compatibility matrix provided by Magento here.
Step 3: Reviewing the Upgrade Process
The error message suggests that either the upgrade process was interrupted or some files were not properly updated. To verify this:
- Check if all core files in
app/code/corehave been replaced with version 1.9. - Confirm that the database schema was successfully upgraded (you should find a new file named
schema-1.9.0.0.php).
Step 4: Reinstating the Backup
You mentioned trying to restore directories from a recent backup without success. To ensure a clean restoration:
-
Backup your current data: Always maintain a database backup before proceeding with any major changes.
-
Reinstall Magento: Instead of restoring individual directories, perform a fresh installation of version 1.7 using the official Magento installer here.
-
Import your data: After the clean install, use the
magento_data_migration_tool(included in the Magento 1.x archive) to migrate your existing data from version 1.9’s database. -
Reinstall third-party extensions: Manually reinstall any third-party modules required for your site functionality, ensuring they are compatible with version 1.7.
Conclusion
Fatal errors after a Magento upgrade can be daunting but are often resolvable by following the right troubleshooting steps and maintaining a clean installation process. Always review compatibility matrices before upgrading, maintain regular backups, and approach major changes methodically to minimize potential disruptions to your e-commerce platform’s stability.
If you’re considering a more modern and feature-rich alternative for your online store, explore the capabilities of Laravel and other contemporary PHP frameworks at LaravelCompany. Upgrading to newer technologies can offer improved performance, better security, and easier maintenance compared to aging platforms like Magento 1.x.