June 10, 2008

Bulk view

Notes on backporting modules from Drupal 6 to Drupal 5

I needed a web statistics module for a Drupal-based project at work, and integrating an external web statistics module seemed to be the way to go in terms of performance and features. BAWstats integrates the popular AWstats web statistics analyzer into Drupal. The module was developed for Drupal 6, so I spent a few hours backporting it to Drupal 5. I don’t know if I can send a patch back (might have to do some paperwork), but anyway, here are some notes so that (a) I can remember how to do this in the future, and (b) it might save you some time.

Backporting from Drupal 6 to Drupal 5: Change the menu items

  • Move the menu path from the array key to the path attribute.
  • Rename

    page callback to callback and page arguments to callback arguments.

  • Remove the file and file path attributes. Move the included files to include_once lines for now, and look for instances of include that need to be changed to include_once. Read the included files to check for unintended execution.
  • Change tokenized menu items (%/%/%) to ones that dynamically build the menu path (arg(1) . ‘/’ . arg(2) . ‘/’ . arg(3)). Don’t forget – this shouldn’t be cached.
  • Change 'access arguments' => array( to 'access' => user_access( or something similar.

Those were most of the changes I needed to make in order to backport bawstats to Drupal 5. Seems to work so far… =) More notes when I run into other things!

IBM Pass It Along – social learning!

I’m happy to share that one of my favorite Enterprise 2.0 tools within IBM is now available on the Internet. IBM Pass It Along is now available on Alphaworks, a public IBM site for people interested in trying out emerging technologies–all you need is a free ibm.com account. IBM Pass It Along is about sharing what you know and learning from other people. If you have a how-to you’d like to share, create a topic for it. If you’re curious about something, request it. If you’re just curious about the crazy tools we use within the enterprise, check it out! =)

Here’s what I love about Pass It Along, and I think you’ll love it too:

  • You can find out who’s learning a topic and see what else they’re interested in. Sharing what I know becomes a lot more fun when I can see who’s learning, because it gives me feedback that what I’m sharing is useful. Lists of people are much better than anonymous hit counts because I can view their profiles to see what else they’re interested in.
  • You can learn from other people’s contributions. People can add links, related presentations, discussion topics, and other updates. For example, the "How to Make the Most of Your Commute" topic I started within IBM drew lots of interesting suggestions.
  • You can create a place for discussions. I give a lot of presentations, and Pass It Along topics are a terrific place to hold follow-up discussions and reach out to more people. I post my presentation material using the Presentation Wizard and include the URL of the Pass It Along topic on my slides. It’s a great way for learners to connect with each other, too.

I also really like how a newbie like me can create value for other people by sharing what I’m learning. =) Whee! I’m copying some of my public content over, and you can find my topics on Pass It Along.

IBM Pass It Along on Alphaworks is a public site open to everyone. Access controls will follow soon, so you can limit topic access to just your organization if needed. IBM Pass It Along is even better inside your organization, where you can link it up with your employee directory or do all sorts of other cool stuff.

Check it out – it might be a great fit for your organization!

IBM Pass It Along