Upgrading Drupal custom modules

0 Comments

Recently we worked on a project to upgrade a website from Drupal 5 to Drupal 6. There were quite a few custom modules and we chose to take advantage of the deadwood, schema and coder modules, as described in this article . This sped up the conversion process, as the deadwood module made many changes on the original D5 code automatically and the coder module pointed us to places in the code that were incompatible with D6 and required modification.

Manual check and modification is still the most important part of this process, though these modules can often be a great help.

The following are some of the issues that we came across in the conversion process:

1) deadwood might automatically make an unwanted change

We found deadwood automatically converted a function some_prefix_access($node) in D5 to some_prefix_access($op, $node, $account) in D6. However, some_prefix was not the name of the current module and this function was not an implementation of hook_access. This automatic change was not desired.

Upgrading from Drupal 4 to Drupal 6 - Converting Flexinode to CCK

0 Comments

When I was upgrading a site from Drupal 4 to Drupal 6, I had also to convert Flexinodes to CCK nodes. Luckily, there is a module that serves this purpose, and you can find it here: http://drupal.org/project/flexiconvert. As you can see, there are 2 versions of this converter - for 4.7.x-0.3 and 5.x-0.3.

I expected that it would be easier to upgrade Flexinode module v.4 to v.5 and when the module upgrades then convert Flexinode to CCK. As recommended, I CAREFULLY read the instructions in readme.txt and converted my flexinodes to CCK. At the first glance it worked like a charm. On the second - I found out that even the new node types were nicely created, but the data itself, for image fields, was not imported (sorry, I already do not remember what exactly was lost).

Another thing to mention here is to make sure you have nice flexinodes' names. Check this: SELECT name FROM `flexinode_type` - in my case one of the names was "page + take action", and no wonder that I get SQL error during the conversion when the Converter tried to create a column name with "+" in it.