Do it like Rails: Version your Drupal Database with hook_update

By Austin Smith on July 17th, 2009 at 11:21am
Posted in Drupal, Drush, Hudson, Migration, Rake and Ruby on Rails

At The Economist, we've been struggling some to keep our database changes 100% in code. We're required to automate everything using hook_update and hook_install. We don't want to be pushing database imports around, and we want our build scripts to create a current database for testing purposes. Also, we want to see how the database is changing over time. How we do it? The answer might not surprise you--the Rake of Drupal is Drush.

2 comments, continue reading.

Giving Credit Where Credit is Due for Observer.com

By Austin Smith on February 25th, 2009 at 10:24pm
Posted in Drupal, New York Observer and Observer.com

After nearly 24 hours of struggling with our new production cluster, two weeks of testing, two months of development, two months of design, and a really long time of seriously headache-inducing brainstorming, Observer.com is finally running Drupal 6, with a totally new look and a totally new philosophy. I owe a post about how we did what we did and what tools we used, but that's tomorrow. I will also provide the source code for every custom module we wrote for the new site as soon as I figure out how to license it. This post is just a thank you note to our staff, partners, and members of the Drupal community who were particularly helpful--on IRC, in person, and some just by writing awesome code.

2 comments, continue reading.

Detect Javascript Using This CSS Selector

By Austin Smith on February 6th, 2009 at 12:04pm
Posted in CSS, HTML, Javascript and Theming

It's a cold day in hell when I care enough about the front-end to make a post like this, but I stumbled across a couple of versions of this and thought I'd post my synthesis. Since it's triggered instantly after is added to the DOM, the remaining HTML loaded by the browser will be styled appropriately! I use it to hide things that I'm going to animate into place with jQuery. Don't ask why I have to animate elements that have already been loaded into the page... it's a sore subject.

<body>
<script type="text/javascript">
$('body').addClass('.js_enabled');

4 comments, continue reading.

Dynamic Form Altering Using #ahah, The Right Way

By Austin Smith on January 26th, 2009 at 10:05pm
Posted in chx, Drupal, Drupal.org, dww and project_issue

Lately I've been wrapped up pretty seriously helping dww migrate Project Issue Tracking to Drupal 6 as part of the Drupal.org sprint in Boston (I'll be joining them on Wednesday). Today I continued work on this issue, specifically converting an old hard coded AHAH routine to use #ahah, eliminating custom security checks and an entire custom Javascript file, not to mention fixing the sheer brokenness of the thing in Drupal 6. I won't walk you through the whole #ahah process; you can get that here. All I want to do is use #ahah to change the structure of a form--and do it it right. Here's what I learned.

2 comments, continue reading.

AirTran has seriously poor taste

By Austin Smith on January 26th, 2009 at 12:15am
Posted in AirTran Airways, Ranting and Whining

Emily and I flew down and back to Orlando this weekend; our return flight suffered a particularly sarcastic flight attendant.

Heard before takeoff, during boarding: "Whoops, one of our wheels just fell off. Oh wait, this isn't a Jet Blue plane..."

Heard right after landing: "How 'bout that dry landing in New York?"

0 comments, continue reading.

Small Victory for Good Browsers

By Austin Smith on January 18th, 2009 at 1:26am
Posted in European Union, Good vs. Evil, Internet Explorer, Microsoft and Opera

Microsoft has to stop bundling IE with Windows in the European Union. Opera, which complained to the EU, cited IE's blantant disregard for web standards. I'm very happy that web standards have finally become a matter of international law, and I know plenty of people who work closer to the frontend than I do that will be happier still.

0 comments, continue reading.

Observer.com Migrates to Drupal 6 Every Night

By Austin Smith on January 12th, 2009 at 4:23am
Posted in Data Migration, Drupal, Free Advice, New York Observer and Observer.com

Every night for the next month, while I am sleeping, all of the data in the Drupal 5 version of Observer.com will migrate to the Drupal 6 version. This means that our editors will always get to see yesterday's content on the build site of the Drupal 6 version and we will have witnessed more than 30 (hopefully) successful data migrations and have plenty of time to make adjustments. When we're ready to launch the site, we'll just let the data migrate as usual, then dump the newly created database and files directory, install them on the production MySQL and NFS servers, and change Apache's configuration to point to the Drupal 6 version--it couldn't be easier, and it won't take me longer than thirty minutes. So the why of this should be pretty obvious who's done this sort of migration before. But the how isn't so clear, or it wouldn't have taken me so long to get right.

7 comments, continue reading.

Taking Opera for a Test Drive

By Austin Smith on January 8th, 2009 at 6:02am
Posted in Apple, Opera and Web Browsers

I've been quite frustrated with Firefox's memory use on my Mac, so I've been shopping for other browsers. Safari is alright, but I don't love how it looks, and it can be a little slow sometimes as well. Camino is nice too, but it lacks some of the features I like. So I decided to take Opera for a spin, and so far I love it.

0 comments, continue reading.

Controlling the HTTP Expires Header

By Austin Smith on January 7th, 2009 at 1:33am
Posted in Caching, Drupal and Performance

So I just submitted my first core patch, followed quick by several revisions. It felt as good as I was told it would. Still tingling.

Anyways, this is an issue that's got to be resolved--it's been stuck for months on one particular problem, which I don't think should be a problem at all. It's very problematic for developers of large scale sites to be unable to adjust the expiration sent by Drupal to the client. My goal in this patch is to give developers this ability and intentionally not address the issue--which, again, has delayed this patch for months--of how reverse proxies are going to deal with it. That's not Drupal's job--it's the job of whoever is connecting Drupal with the reverse proxy, and any attempt to solve this on the Drupal Core level will require not using PHP Sessions for users that aren't authenticated. Turn the page for the proof.

8 comments, continue reading.

New Domain, New Theme

By Austin Smith on January 5th, 2009 at 3:37pm
Posted in Inertweb.com and netaustin.net

I've moved my blog from inertweb.com to netaustin.net, and changed the theme pretty dramatically. I wanted a cleaner look, and didn't want to use Inertweb.com anymore; it says nothing about what the blog actually is. Netaustin, however, is my handle just about everywhere.

1 comments.