Fun learning to (ab)use drush

Events happening in the community are now at Drupal community events on www.drupal.org.
James Gutholm's picture

I had an enlightening experience related to learning drush that I though others might find interesting or laughable.

For the last two weeks, I've been struggling with a problem. We have a content type that is being updated via feeds. About 500 nodes with 20+ fields. Every time feeds import would run, all but 4 of the fields would appear empty. Even when the feed found no new or changed nodes in the import. Looking in the database, all the fields were there with the correct values. ????. Clearing caches didn't help and then I noticed that if I was on one of the nodes with empty fields while clearing the caches in the admin menu, everything would magically appear in all the nodes. Baffling.

I had to add another field to the content type, for a different reason and noticed that this field did not have the issue. After trying everything I could possibly think of, I finally gave up and decided that I would create a new content type, all the fields, setup the 2 very complex views and the feeds import because it was just broken.

Being lazy, I figured I'd create the fields via drush like I did in the first place and dumped the existing field list, also with drush. To my surprise, the 4 working fields and the one new one all had the bundle name "candidate" and all the broken ones had the bundle name "Candidate".

It turns out that I accidentally got the upper case C in there in my original commands and drush dutifully created the fields. Amazingly, 99% of Drupal was perfectly okay with this scenario. A quick database update of the bundle names put everything right.

For fun, I tried creating a field with a totally bogus bundle name.

The lesson was, drush will happily do as you say so watch what you tell it.

Comments

The PDC web site is live

James Gutholm's picture

If anyone is interested, in addition to the development we are doing in-house, our new website, also drupal running on Pantheon went live on 4/11. Most of the work was contracted.

Olympia, WA

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week