David Luhman's blog

Upgrading Drupal 6 to Drupal 7 Using Git

Posted on October 13th, 2010 by David Luhman and tagged , , , .

The Drupal UPGRADE.txt file and upgrade handbook page provide a lot of good information and procedures to perform a major upgrade (ex. 6.x => 7.x).

However, if you're looking to manage your Drupal 7 installation using Git, the upgrade guides don't provide Git-specific advice.

Here's a procedure I found useful when upgrading Drupal 6 to Drupal 7 using Git.

First, clone the Drupal 7 git repository using this :

git clone git://github.com/drupal/drupal.git

Updating a Drupal Installation - Minor Update

Posted on October 12th, 2010 by David Luhman and tagged .

Here's the process to perform a minor update to a Drupal installation when using a combination of CVS (from Drupal.org) and Git (from your site). This would be used, for example, when updating Drupal 6.18 to 6.19.

This uses the "combined" method of pulling Drupal from CVS but managing branches on the actual site using Git. This method is outlined here :


    $  git checkout drupal-core

HTML Tidy options in PHP context

Posted on September 5th, 2010 by David Luhman and tagged .


// http://tidy.sourceforge.net/docs/quickref.html#add-xml-decl

$tidyOpts = array(
// 'bare' => TRUE, // strip MS HTML
// 'clean' => TRUE, // strip presentational tags
// 'css-prefix' => 'calc-', // CSS prefix for styles - default 'c'
// 'doctype' => 'omit', // DOCTYPE for output
// 'drop-empty-paras' => TRUE,
// 'drop-font-tags' => TRUE, // drop and with no corresponding style rules
// 'drop-proprietary-attributes' => TRUE, // drop things like MS data binding attributes

Scmbug for Git/BitKeeper - Bugzilla Integration

Posted on August 24th, 2010 by David Luhman and tagged , .

I ran across an interesting open source program called Scmbug. Scmbug is a system that integrates software configuration management with bug-tracking.

I was looking for a tool that would help with :

  • Showing what bugs are fixed in a particular build or revision control commit?
  • Automatically updating a bug tracker when bugs are completed (fixed) and approved.
  • Not allowing unapproved bugs to be committed to a given branch.

Getting "git rm" to work

Posted on August 5th, 2010 by David Luhman and tagged .

I thought I could remove files from Git pretty easily with essentially :

  $ git rm myfile.php
  $ git commit -m "Removing a file"

But I was getting this error upon commit : "Could not open input file myfile.php"

This is how I got it to work. The Git Cheat Sheet (http://cheat.errtheblog.com/s/git) described this as "Commit the absence of myfile.txt to the project"

  $ git rm --cached myfile.php
  $ git commit -m "Removing a file"

Introduction to Git for Drupal

Posted on June 23rd, 2010 by David Luhman and tagged , .

Here's a PDF copy of the presentation I'll be giving at DrupalCamp Colorado in June, 2010.

Introduction to Git for Drupal

PHP-oriented job or queue manager

Posted on June 18th, 2010 by David Luhman and tagged , , , .

I'm looking for a way to manage asynchronous, potentially long-running PHP jobs (ex. feed import and generation). One could start with a simple cron-based system, but this has a few drawbacks :

  • Too much 'downtime' if you set the sample interval too long
  • Overlapping jobs if jobs don't finish
  • No ability to handle events or dependency issues

I've previously used AppWorx (appworx.com) in a large ETL operation. AppWorx is quite sophisticated with a distributed slave architecture, chains, forks and joins. But AppWorx is probably too complex for my needs.

Setting up slave servers for Hudson

Posted on June 18th, 2010 by David Luhman and tagged .

If you're running the Hudson continuous integration server, you may want to run/build/test on multiple slave servers.

To do this, log into the Hudson web interface and go to Hudson > nodes. Configure your new slave server by adding the name, description, remote file system root for Hudson (ex. /var/hudson), and the job launch method.

For job launch method, ssh is fine for Linux based systems. Click the 'Advanced' button to enter ssh details (ex. keys).

Now, when you start up the slave, you may see this in your slave ssh log under the Hudson console output :

Drupal 7 Views 3 column names must be lower case

Posted on June 6th, 2010 by David Luhman and tagged , .

I'm just getting my feet wet with the Drupal 7, Views 3 hook_views_data API which describes a table to Views.

I had a table like this :

create table tbl(
  myid    varchar(30) COMMENT 'Primary key',
  myPrice float

I was getting an error of this form when I was trying to display the view :

Undefined property: stdClass::$tbl_myPrice in
 views_handler_field_numeric->render() (line 75 of 

Renaming the table to my_price solved the problem.

How to override the "formatting tips" section in Drupal's node creation

Posted on May 27th, 2010 by David Luhman and tagged .

Drupal provides some "formatting tips" just before the submit button when creating nodes.

Sometimes you want to override this text to provide your own "tips" for node creation. Here's how to do this :

In your theme's template.php file, add the following function :

function phptemplate_filter_tips($tips, $long = FALSE, $extra = '') {
return 'Your tips here';

Also see this post : http://drupal.org/node/35122