Drupal

Making sql-sync Safer

Drush aliases can be a huge timesaver when you’re working back-and-forth between your local dev environment and a remote server. You can clear caches remotely as easily as adding @remote to your usual drush cc all command. Or use the sql-cli command to log into the remote server’s MySQL instance without leaving the comfort of your local command prompt. My favorite is updating my local database to what’s on the remote server: drush sql-sync @remote @local (followed by a coffee break).

Adding Custom Mobile Protocols to Drupal

With the proliferation of mobile apps and Web sites on mobile devices, developers are often asked to integrate the two. Mobile apps can register a custom protocol with the mobile OS so that a link on a Web page such as <a href=”myapp://openapp”>Open in MyApp</a> will open MyApp on the user’s phone. An early example of this was to have links on phone numbers actually call the number on mobile phones.

Migrating a CCK Field into the Node Title Field

On a recent migration project I came across an odd error:

Illegal offset type in isset or empty File ...snip...\sites\all\modules\pathauto\pathauto.inc, line 182

I was using Migrate 2.5 to move date from a Drupal 6 project into Drupal 7 and had already migrated several content types without having problems with my pathauto settings.

A Drupal Developer’s Setup on Windows

UPDATE: 3/23/2013: In general, these instructions still work for Windows 8. While some of the UI aspects have changed, the basic directions are the same. One exception is when downloading PuTTy. Since it’s an unsigned .exe file, Windows will boldly claim that “Windows protected your PC.” Click More info followed by Run anyways and you’re on your way.

UPDATE: 4/22/2012: A few more scattered updates, plus a new section on setting up XDebug on Aptana for super-easy  debugger config.

Writing a Views 3.x Example Plugin

I'm posting this so I won’t forget it the next time I need to do something similar.  This is by no means a complete explanation of the new plugin architecture, it’s more of a quick list of gotchas.

1. Building a skeleton example plugin

You will need a module to implement a Views plugin.  Within that module, there are three items needed to create a minimal plugin: