Ramblings

Drupal login redirection

Submitted by Erik on Mon, 12/12/2011 - 20:51

One handy trick I've found is that when you're visiting a Drupal page and you notice that you're not logged in, you can simply add user?destination= into the URL right after the root of your Drupal site and keep the path. This means that

http://eporama.com/ramblings

becomes

http://eporama.com/user?destination=ramblings

Then when you log in, you're brought back to the page you were viewing with no fuss.

I do this often enough that I decided to make it a bookmarklet.

Migrate nodereferences with dissimilar keys

Submitted by Erik on Tue, 10/25/2011 - 02:06

I ran into a problem using the Migrate module where I migrated a series of newsletter issues and then imported a series of articles that were related to each newsletter.

Typically, for nodereferences, you can add a dependency of the first migration. If both the newsletter issue table used a primary key and the article table used a foreign key of "issueid" then the mapping is very straight forward.

Develop Locally

Submitted by Erik on Mon, 10/17/2011 - 01:19

I presented at Drupal Camp New Hampshire 2011 and Drupal Camp MA 2012.

This talk was about running Drupal locally and how to set up a good development environment.

Edit: [2011-11-10] Just found out there's an error on the location of the my.cnf file. MAMP 2.x wants them in /Applications/MAMP/conf ... slides updated.

Setting up a Mac development environment

Submitted by Erik on Sun, 05/29/2011 - 23:46

There are many ways to get Drupal running on your Mac. OS X comes preinstalled with PHP and Apache, so theoretically, you'd only need MySQL. Acquia makes a separate version that includes Drupal, Apache, MySQL, and PHP (aka DAMP) already set up. This version is great if you really want to get up and running quickly. It's tied to the Acquia distribution of Drupal which has some extra features that we don't tend to use for our development.

Updating Drupal Core without command-line tools

Submitted by Erik on Sun, 05/29/2011 - 01:24

(No drush!?!? #inconceivable)

With all of the fancy ways to upgrade Drupal core floating around: drush, git, diff, patching. What if you only have FTP?

As always, the first steps are to a) plan, b) backup, and c) be flexible.

It always helps to have a plan. Write it down, think it through, practice on something other than your production site.

How I update Drupal core

Submitted by Erik on Thu, 05/26/2011 - 18:46

When new security releases come out for Drupal, updating is definitely something that you want to do sooner rather than later. My philosophy has generally been to update my local setup immediately, let all of our developers/users know that I am going to update the shared dev server within two days, then schedule a time to update production based on any issues we find with the dev server. Since we run most of our sites as a rather large multisite, it means updating everybody at once, but hey, that's what dev's for, right? Well, we'll leave that for another discussion.