Drupal social publishing software

Drupal is a powerful content management system and framework that makes building powerful websites possible for mere mortals. Some of the posts here will be syndicated to Drupal planet.

Jun
17
2012

Setting up Xdebug with Acquia Dev Desktop for local debugging

A while back Robert Douglass had written a great guide to setting up Acquia Dev Desktop to use Xdebug on Mac OS X. Looking for it today it looks like the sands of time have erased it from the webs. At the same time the recent versions of Dev Desktop include Xdebug so the process is a little different (and simpler).

In this case I'm setting up Xdebug to work with Komodo IDE and Dev Desktop that comes bundled with Drupal 7. After installing Dev Desktop and setting up your first site it's time to enable Xdebug. In the recent versions of Dev Desktop it ships with Xdebug but the PHP extension is turned off.

The first step is launching the Dev Desktop control panel. Once it has started click the "Settings..." button in the lower right. Then pick the "Config" tab at the top center to see the server configuration. The screen shot here shows PHP 5.2 but the process is the same for 5.2 or 5.3. Whichever version of PHP click the Edit link beside the php configuration files.

Settings panel with Edit highlighted

This will open the chosen php.ini file in Text Edit. With the file open look for the line containing xdebug.so. If the installation is in the standard directory it will look something like this:

Feb
4
2012

Drush make and Pressflow

A quick note on using Pressflow as the basis of a Drush build using Drush make can be a little confusing as the changes necessary to use the newer github-based repository aren't abundant. So without further ado here's what works:

projects[pressflow][type] = "core"
projects[pressflow][download][type] = "git"
projects[pressflow][download][url] = "https://github.com/pressflow/6.git"
projects[pressflow][download][tag] = "DRUPAL-6-24"

Note that the previous instructions around the web tend to be problematic because the tarball file contains a git repo which Drush make doesn't know to strop since it's getting it as a tarball instead of from git.

Dec
1
2011

Create custom Adjix short URLs with Alfred

Alfred.app Logo Although I use it all the time it turns I haven't written here about Adjix. There is one mention in some issues but nothing that spells out just how awesome it is. The short version is Adjix is hands down the single best URL shortener out there. While it deserves it's own post suffice it to say you can use its power and still retain a copy of your links on your own S3 drive. Future proofing at its best.

But this post isn't about that. It's about using your own custom domain and setting up a URL shortener that works from Alfred. Alfred is itself another awesome tool that deserves yet another post. Inspired by a post on Dirt Don I set out to create a url shortening shortcut. (Recursion is encouraged).

So based on this post I setup a quick shell script shortcut in Alfred. The properties end up looking something like this:

Nov
26
2011

Drush away unserialize() errors

When you work with the great folks I do every day it comes as little surprise that when the stuff hits the fan and some site is in need of help there will be a legion of folks who jump into round-the-clock action to get things in a better place. While this could be a whole blog post about that alone it's not about that. Rather it's about one of those nagging little problems we came across while working on a site this Thanksgiving "holiday".

The problem is one that many have seen at one point or another:

[26-Nov-2011 22:35:17] PHP Notice:  unserialize() [<a href='function.unserialize'>function.unserialize</a>]: Error at offset 200 of 1100 bytes in /var/www/mysite/includes/bootstrap.inc on line 1104

In fact this problem pops up enough that it has its own page in the Drupal Handbook. The problem is pretty straightforward to understand. Some object was serialized for storage in the database and has become corrupted.

Finding the source of the problem, however, can be challenging. The Handbook page has several examples and more in the comments of some quick hacks that can be done to bootstrap.inc or can be employed with their own database connections to test these serialized values. There are times when neither hacking bootstrap.inc nor connecting to the db directly are practical. Indeed for many using Drush is a good way around both of these. I spent a couple minutes looking and didn't find any scripts out there yet so I cobbled together a quick Drush command to help out here.

Aug
25
2011

How to Survive and Thrive at Drupal(con) London

From the opening session of Drupalcon London. This is a handheld video but you get the idea and hopefully a more complete video will be recorded at some point. This video shot from a handheld phone isn't the greatest but you get the idea. The final 5 minutes of the video will have to be posted separately.

Thanks to the wonderful team in London for putting on a great Drupalcon. Looking forward to seeing everyone in Denver next March.

The venue video has now been posted here and is shot from a tripod and much easier to watch. The actual presentation starts at the 3 minute mark.

Mar
19
2011

iPad's greatest flaw

ipad_connect_to_itunes.pngA post on Dave Winer's blog today reminded me that I've been meaning to write about the big flaw in the iPad. Actually it is a flaw in iOS but I notice it most on the iPad.

First a little background. I've had an iPad for as long as they've been around and eagerly stood in line for the iPad 2's new cameras. More than the first iPad the iPad 2 is a transformative device. It is comfortable to hold in bed to read, it has an amazing cover that just works and it's a bright white color instead of the heavy black. (How the color affects the perception of weight is another topic for another day.)

As awesome as the device is for me. It comes with a horrible flaw. This first came to light the very night I picked it up. After the headache of convincing my credit card issuer that yes it really was me staying in a hotel and buying an iPad at an Apple store I met a friend and we headed out for dinner. Being a Drupalcon dinner there were plenty of tech folks. Since the line for Chicago pizza was longer than the line for the iPad 2 we had plenty of time to talk. Eventually I succumbed to peer pressure and opened the box.

While peeling away the shrink wrap on the box (even the box is slightly smaller than the previous iPad) thoughts of taking a few pictures of the group with the new iPad came to mind. With a creative group of smart people what could we do with this new technology while waiting for a dinner with a week's caloric intake? And then all at once it happened.

Nov
14
2010

Scrubbing Drupal databases for development

A couple of weeks ago I delivered a webinar on how to manage the process of moving Drupal websites from development to staging and production. The presentation gives an overview of the process including a few key points for the key pieces. Here are the key points:

  • Manage sites in code (keep configuration and updates in code)
  • Have an effective version control system
  • Test, test and run more Tests

In the presentation I covered a pair of scripts that form the basis of creating a scrubbed database for use on development machines. This is a good practice for several reasons including making sure that a development server doesn't send emails or data to Google Analytics for example.

The first piece is a shell script like this:

#!/bin/bash
# Use as ./sql_scrub_dump.sh local_db_user local_db_pass dump_file.gz

# Creates a scrubbed version of a database dump using the local database defined below as the intermediary.
# note: the dump file will be gzip compressed, as will te resulting file.

local_db=6000_temp_scrub

function db_query() {
    sql=${1}
    mysql -u${local_user} -p${local_pass} -e "$sql" ${local_db}
}

local_user=${1}
local_pass=${2}
dump_file=${3}
new_dump_file=scrubbed-${3}

mysql -u${1} -p${2} -e "DROP DATABASE IF EXISTS $local_db"
mysql -u${1} -p${2} -e "CREATE DATABASE $local_db"
gunzip -c $dump_file | mysql -u${1} -p${2} $local_db

mysql -u${1} -p${2} $local_db < scrub.sql
mysql -u${1} -p${2} $local_db < live_to_dev_scrub.sql

# Here we make sure that all the tables are InnoDB.

mysql -u${1} -p${2} -e "SHOW TABLES" $local_db \
  | grep --invert-match '^Tables' \
  | sed -e 's/\(.*\)/ALTER TABLE `\1` ENGINE = innodb;/' \
  | mysql -u${1} -p${2} $local_db

# Dump the scrubbed version and drop the temporary DB.

mysqldump -u${1} -p${2} $local_db | gzip > $new_dump_file
mysql -u${1} -p${2} -e "DROP DATABASE IF EXISTS $local_db"

If you look through what this shell script does it dumps a copy of the database and creates a new database from that dump. In the new, temporary, copy of the database transformations are performed to clean up the data. The cleaning actually happens in this line:

Jan
13
2010

Flagging Drupal Planet

flagger_sign.jpg A little over a year ago I blogged about moving to using a Drupal Planet tag to determine which posts about Drupal get posted on Drupal Planet. This is certainly better than having every Drupal related post appear in Drupal Planet. Why not send everything? Well there are a number of smaller posts that don't need to land in the hundreds of RSS inboxes around the globe but should still appear on my site.

However, the separate tag method has its drawbacks. For one thing it means my site now has, by default, two pages of Drupal posts. One contains all the posts and the other just those that went to Drupal Planet. Visitors to my site, however, don't need to see this distinction. In fact they are put off by it because it's a nonsensical differentiation for these visitors. Even somebody following a link from Drupal Planet is left with just a few posts and might not find some other smaller posts that could be helpful.

Given that the ability to post content and selectively send it to Drupal Planet is important and that I'd like to do so without hindering the usability of my website what's the solution. In true Drupal fashion there's a module for that. In this case it's the Flag module to be precise. Here's a quick look at this simple setup.

After installing and enabling the Flag module the next step is to create a Drupal Planet flag. Adding a flag starts with visiting Administration >> Site Building >> Flags >> Add (/admin/build/flags/add) on the site.

A couple of settings are key to making the Drupal Planet flag work well. First it should be a "Global" flag meaning that each node is either flagged or not and individual users can't set the flag differently on each node.

Nov
8
2009

Multisite and more presentation from SANDCAMP

This is definitely in the better late than never category. Back in January I did a presentation on Drupal multi-stite at the San Diego Drupal Camp and near as I can tell I never quite got around to posting the slides. In fact I even modified the presentation a bit and gave a similar talk at the May Boise Drupal User's Group meeting. So here's that presentation for your viewing pleasure.

Download the PDF version of the slides here.

Oct
27
2009

Connect Drupal sites to social media

Last weekend the fantastic folks at the Seattle Drupal User's Group (SEADUG) put on a fantastic Pacific Northwest Drupal Summit at the Adobe campus in Seattle. I hope to get some time to post some reflections on the many great sessions. In the meantime here are the slides from a talk Jakob Perry and I gave on connecting your site to social media.

You can download the slides here. Unfortunately the slides don't show the demo of the Gigya module for Drupal. However the demo was similar to one that was presented in the Acquia webinar a couple of months ago. You can watch it below.

Syndicate content Syndicate content