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.
Eclipse Configuration for Drupal Development
These configuration steps used to reside in my Drupal Developer's Setup for Windows post. But I've since switched to Sublime Text 2 so the steps in that post changed drastically. I've archived the Eclipse/Aptana settings here, just in case they are still of use to anyone.
Browsing the Drupal 7 Variable Table
Drupal's variable table -- where most admin settings are saved -- had an overhaul between Drupal 6 and Drupal 7. No longer is it simple to browse the table with the SQL command line or using tools such as phpMyAdmin. Here are a few tricks to make browsing this table simple again.
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.
New to Drupal: Better Core Community
The biggest change in Drupal over the past year is not the Git migration or the release of Drupal 7 , both of which were fantastic steps forward for Drupal. It’s the more inclusive developer community.
SQL Injection Humor
See the cartoon after the jump...
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:
AWS “Micro” Instances or How Web Sites are like Mini-Marts
I’ve been tossing about the idea of moving some of the sites I host to Amazon Web Services , specifically EC2 (server), S3 and EBS (storage) and CloudFront (content delivery network). Price was my excuse for not jumping (OK, the real reason is the inevitable pain that comes with moving hosting providers) but with today’s introduction of “Micro” instances, I no longer have that excuse.
AWS now can host my sites for roughly the same price I pay for shared hosting!