drupal

Currently looking for small Drupal projects

Blog

I'm currently looking for Drupal contract work. In particular, I'm looking for smaller projects, short-term work. A smaller project can be an entire project start to finish for a site that is well defined in terms of features and can use most of the modules that currently exist (that is to say, minimal custom work); or a part of a larger project. The small part of a larger project appeals to me, as I enjoy working in groups and seeing parts come together into a fantastic whole.

My resume is Drupal heavy as of late, and I'd like to continue that. I am not, however, opposed to other PHP work. I'm good with PHP, MySQL, HTML, CSS, browser Javascript (drifting towards jQuery), integrating sites together (consuming APIs, so to speak), and Linux/Apache/SSL site setup.

Please do contact me if you have a Drupal project (or maybe another project that could be otherwise interesting, no sense in limiting myself to just Drupal!).

drush skip svn checking

Snippet

Skip SVN checking of current status when updating

drush upc --version-control=backup --no-backup

Turning off Drupal 7 admin toolbar

Blog

Drupal 7 has this nice lovely toolbar at the top of admin pages, right?

It's a great idea. It adds easy access to important parts of the website. It's a great improvement from the standard administration workflow.

It also doesn't provide the delightful dropdown menus of the Administration menu toolbar. I don't like the Drupal 7 admin tool bar. Yes, it stays put (position:fixed), but it's the bastard half brother of what I'm used to having.

The easiest way to disable the default admin toolbar and enable the admin_menu toolbar?

After installing the Administration menu, in admin/people/permissions:

1. Enable Administration menu » Access administration menu for the role you want (I updated the Administrator role).

2. Disable Toolbar » Use the administration toolbar for the role you want (I updated the Administrator role).

No code modification. Yay!

Get the bundle of a Drupal 7 entity

Snippet

Drupal 7's EntityAPI allows entities to be divided into different "bundles" based on their properties. Unfortunately, there's no way to easily determine what bundle a particular concrete entity object belongs to. This helper function appears to work for the entity types that ship with core.

function _entity_get_bundle($entity, $entity_type) {
  $info = entity_get_info($entity_type);
  if (empty($info['entity keys']['bundle'])) {
    return $entity_type;
  } else {
    return $entity->{$info['entity keys']['bundle']};
  }
}

Drupal 7 Multiviews Error fix

Blog

Installing Drupal 7 for a project, received a 500 Server configuration error.

Looking in the Apache error log, I saw the error:

[Wed Jan 12 19:40:24 2011] [alert] [client xxx.xxx.xxx.xxx] /var/www/httpdocs/.htaccess: Option Multiviews not allowed here

Turns out, in the apache2 config file, the following is not sufficient in the Directory section:

AllowOverride Options FileInfo AuthConfig Limit Indexes

In particular, the MultiViews option is needed:

AllowOverride Options=All,MultiViews FileInfo AuthConfig Limit Indexes

Execute an arbitrary SQL command in Drupal 5

Snippet

If execute PHP is enabled (in a block), the SQL to execute an arbitrary SQL command.

$res = db_query('show tables');
while ($row = db_fetch_array($res)) { print_r($row); }

Pages