How to Perform a Complex Magento E-Commerce Upgrade – Part 3, “Typical Problems”

FacebookTwitterGoogle+PinterestWhatsAppStumbleUponShare

The following article is part 3 of a multipart series on performing Complex Magento Upgrades (versions 1.4 – 1.9 CE with many theme changes and custom modules). Part One, Preparation and Part Two, “Rock the Diff”

Problem: Forms no longer submit, or they submit, but appear to “do nothing”.

Solution: Inject the following code into the form tag of your template:

<?php getBlockHtml('formkey'); ?>

Explanation: You’ve modified a template. Magento introduced Cross Site Request Forgery (CSFR) protections in CE 1.8, injecting “formkeys” in all forms. Any forms which are missing this block, silently stop working.

Problem: Catalog search returns different results.

Solution: Consider changing to a “full text” or “combined” search type. See See jharrison’s Stack Overflow Answer.

Explanation: The “like” search was changed from “AND” to an “OR” search sometime after 1.4.

// From /app/code/core/Mage/CatalogSearch/Model/Mysql4/Fulltext.php
$likeCond = '(' . join(' AND ', $like) . ')'

whereas version 1.9 includes

 $likeCond = '(' . join(' OR ', $like) . ')'

Problem: “Forgot Password” and “New Registration” email no longer contain passwords 

Solution: Update your customized email templates. Include a “password reset” link instead of clear-text passwords. You can do this within Admin -> System -> Transactional Emails.

Explanation: Magento (finally) stopped storing passwords in clear-text, and now requires a link to reset password. If you customized email templates, you’ll need to copy from a clean version of the site. See: http://magento.stackexchange.com/a/
46793/24381
and http://www.neubreed.com.au/blog/2013 /03/magento_upgrade_killed_forgot_password

Problem: Custom fields not appearing on back or front end.

Solution: Modify your installation scripts (e.g. app/code/local/Acme/
Customer/sql/acme_customer_setup /mysql4-install-0.1.0.php), instructing Magento which form fields should appear:

->setUsedInForms(array('adminhtml_customer'))

becomes:

->setUsedInForms( array( 'adminhtml_customer', 'customer_account_edit',
'customer_account_create', 'checkout_register'))

Explanation: Magento 1.5 added a new table, “customer_form_attribute” which identifies where fields appear. This table should be populated for your custom field to appear. You can manually populate it, but it’s much better to add to the setup script, which is run when the module is installed.  (Delete from table “core_resource” table to re-run the install scripts).

Problem: Order emails not being sent

Solution: Install http://support.xtento.com/wiki/
Setting_up_the_Magento_cronjob

Explanation: Later versions of Magento require a cron task to be running. The cron task polls the site and sends emails when required.

Problem: Fields not saving in admin section.

Solution: Modify your custom module setup script to include:

setData("is_system", 0)

Explanation: The table,

customer_eav_attribute

has a new column, “is_system”. Make sure this column is being populated by setup script.

Problem: Errors in templates using loadParentProductIds() function.

Solution:

$parentIdArray = $_product->loadParentProductIds() -> getData('parent_product_ids');

becomes:

$parentIdArray = Mage::getModel('catalog/product_type_grouped') -> getParentIdsByChild($_product->getId());

Explanation: loadParentProductIds was deprecated in a version after 1.4


 

Hopefully these tips help you with your Magento upgrade. Reach out any time you need some help with your migration!

 

FacebookTwitterGoogle+PinterestWhatsAppStumbleUponShare
Posted in Legacy, Magento