Subscribe To RSS Feed


Mike D's SharpBlog

Just another Sharpdot weblog

Archive for June, 2010

Magento: Upgrading to 1.4

- Wednesday, June 9th, 2010 -

This is my upgrading Magento to Version 1.4 journey.

Here is how I decided to go about it.

  • Backup the database!!
  • Clear all cache and disable caching
  • Move code into a SVN Branch (assuming you use source controll, if you don’t you should!)
  • Remove Old Core Magento Code (just leave community and local modules, keep my theme folder)
  • Download Full Release from Magento’s Website(don’t use the downloader, use the full release!)
  • Extract the New Release into the SVN Branch that was created earlier
  • If your template was a sub-template of anther theme then you need to merge them together to use in 1.4. This is due to the fact that 1.4 changed a bunch of classes and layouts. Or you could start from a fresh theme and re code it.
  • Change the theme to a default theme until you are sure that the update went ok.

Errors and Bugs I came across:

  • When Trying to run indexing I got the following error, “can’t initialize indexer process”. This was because I was missing some database tables that failed to install during the upgrade. I installed and ran the database repair tool.
  • Had to disable WYSIWYG so that page templates did not get messed up.
  • The file “catalog/product/list/toolbar.phtml” changed quite a bit, so if you modified this file grab the new one then start from there. Also the file “page/html/pager.phtml” needs to be update the the 1.4 version if you modified this file.
  • When editing or adding products the Category Tree was only showing the Default or Root Category.
    To Fix this I just created a new subcategory of the root catalog and move all the categories into this new category then move them back to there original position. This must rebuild what ever was messed up in the database.

Tags: , ,
Posted in PHP, Uncategorized, magento | No Comments »

Drupal: Adding Nodes Programaticly using drupal_execute()

- Friday, June 4th, 2010 -

I recently had to migrate data into Drupal. To do this I decided to just run drupal_execute(), to create the nodes. I ran into a few quirks and thought I would share my trials with the world.

My first issue was, How do I get the new node id that was created by drupal_execute(). Well It was easier than I thought. I did a little goggling and found people saying that you should use db_last_id(), well that did not work for me. Instead I used the “$form_state” variable that I passed into the drupal_execute function. I noticed that after running drupal_execute() I could use $form_state['nid'] to retrieve the nodes id. Wow wasn’t that easy.

The nodes I was creating were using cck fields. I noticed that only the first node’s cck fields were created correctly. All subsequent nodes were created with cck fields containing just 1 character(I believe this only happened on select fields). To fix this issue I had to use the node id that I retireved and set the cck fields again. Then do a node_save(). Now all my fields are correct and I can go Fishing.:)

Posted in Uncategorized | No Comments »