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.

A one-liner for Drupal 7.32 security update

Yesterday an important security update was released for Drupal. This update, Drupal 7.32 is a highly critical update for everyone running a Drupal 7 site.

You may have seen a tweet where I posted the following suggestion which works on OS X:

sudo find . -name database.inc | grep "/includes/database/database.inc" | xargs sed -i '' 's/$data /array_values($data) /'

On linux the arguments for 'sed -i' work a little differently and this works better:

sudo find . -name database.inc | grep "/includes/database/database.inc" | xargs sed -i 's/$data /array_values($data) /'

Twitter might be good for getting the message out but it doesn't provide the space to explain. Why would one use this? Wouldn't it be better to just upgrade to Drupal 7.32?

Drush and cloning

I need to pull down a site I have on my other computer but haven't setup here for local development. I keep thinking there should be a 'drush clone' command... well there is but it clones modules not the way I'm thinking of. Basically the command I have in mind would:

  1. Clone the git repository of the site into the proper local directory.
  2. Copy the files from the production or developer site.
  3. Create the local database and sync from production or developer instance.
  4. Or instead of syncing the database do a site install if that's called for.

This requires of course that drush aliases already exist for the site. How to handle this and keep everybody in sync. Well, here's my stab at a highly configurable, very customizable drush configuration for people who work with one or more teams.

More Alfred and drush love

A couple years ago I started playing with using the stellar Alfred.app with drush to get things done. This post describes how I used a now defunct URL shortener to create short links from Alfred.

Fast forward a couple of years and Adjix is no longer but the basic script still works. However it had run into a couple of issues like being hard-coded to drush paths which can vary from machine to machine. This was because the non-interactive shell wasn't picking up all the wonderful things like my $PATH definitions in settings files. So a bit of work later and this script now looks like this:

#!/bin/bash
source ~/.bashrc
echo `drush @site.env ev 'print (shorten_url("{query}"));'`

That's it. Well there are two outputs of the workflow. The first copies the results of the statement to the clipboard. The other posts it to Notification Center so you know the work is done and get to see the URL for your shortened link.

Hosting Drupal sites on CloudFront

So the term hosting may be technically inaccurate here. However the practice of deploying sites entirely behind CloudFront recently got much easier. The change came in this announcement that CloudFront now supports POST requests. A long time (years) in coming, this now gives options to sites that would like to have quick setup with a CDN and have lightening fast sites with minimal setup. I'll post more soon on how to do it but it's great to know that it's possible now.

Farewell comments

For quite some time I have been thinking about how to make sites that are more useful and better assembled. No this is not a post-CMS look how we're managing content like it is 1995 post. But how to best put together sites that have services that the site or a small group of sites consume. The Distributed Blocks module in Drupal is a piece of this that I have batted around with several folks much brighter than me (I don't have any experience with the Distributed Blocks module or involvement in it's creation just an example of the sort of distributed SaaS solution I've envisioned.)

At any rate while I was doing some work on this site today I was facing the problem of what to do with commenting. The comments here haven't been used in a long time for anything but an attempt to spam the site. In the typical flow of things there are waves of time when spammers overwhelm or come up with a new technique to get past the excellent Mollom service. Over the last few years I've removed far more spam posts than there have been meaningful additions.

And so it becomes Drupal 7

It has taken far longer than one might have guessed but after many months of sitting mostly dormant this site finally got an upgrade to Drupal 7. Eventually maybe it will get some new functionality but for now we'll settle for a clean, responsive design.

The responsive design comes from a theme based on the contributed Corolla theme. Otherwise things are quite similar.

So while it's true what they say about the cobbler's children going barefoot the public view at least matches what I've been seeing for a while. And we won't talk about the state of the children's websites.

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).

Settings panel with Edit highlighted

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.

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:

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.

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:

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.

Pages

Subscribe to Joshua Brauer: All Drupal items Subscribe to Joshua Brauer: Drupal Planet only