Drush entity support (patch needs review)

http://3wavesmedia.com/sites/default/files/drush.png
Can you tell the field display weights of all your entities with one command? Or edit a node through the command-line?
drush --yaml entity-type-read node --fields=**/display/**/weight --include-fieldapi
drush entity-update node 12 --json
Watch the video on http://www.youtube.com/watch?v=cVGZzWjdDh8 and get convinced you want to know more of these entity internals.

grep those gits aka drupal contribs

http://images.icanhascheezburger.com/completestore/2009/1/21/128770736688691365.

Following along the git migration and project cannot be grepped anymore I brewed the following code.

It assumes the gits are already cloned and placed is one common directory.

After running the script all repositories with a $major == 7 branch are set into the highest version.

I'm puzzling how to 'empty' the non $major compatible repos.

The fun part is now doing analysis on the tree

Upgrade from D6 in 7 steps? Hell no!!!

http://dancingczars.files.wordpress.com/2010/06/hellno.jpg
Sooo ... I've finally upgraded my own site. I thought it would be easy. A simple drupal site only using images. And yes I'm not reading READMEs that often. I trust drush somehow to handle this for me. But drush only sooth the 'pain'. This blog contains my bash script which does some staging from production onto my laptop where I update the site to the latest D6 then upgrade to D7. The script is generic enough to adapt for other upgrades.

Searching an issue on drupal.org with jQuery.grep

On http://drupal.org/node/686938 people are reporting a lot sloppy reports of error lines. The issue is about
Undefined index: [xyz] in line ...

But what are the names of the failing indexes?

jQuery has a nice grep so lets use it.

How to get that site on localhost?

drush logo

Make sure you have your drush aliases file setup properly. Below a snippet from my b2b.aliases.drushrc.php

$aliases['dev'] = array(
  'uri' => 'http://build2be.dev',  'root' => '/Users/clemens/Sites/build2be.dev/www/',
  'path-aliases' => array(
    '%dump-dir' => '/Users/clemens/Sites/build2be.dev/store',
    '%files' => '/Users/clemens/Sites/build2be.dev/www/sites/build2be.dev/files',
  ),
);

Now we can run

drush rsync @b2b.prd @b2b.dev

Git issue branch ... the sandbox route

http://emonti.github.com/buby/img/buby_pacifier.png

I'm working on a patch to implement issue triage for Dreditor

But for ease of use and teasing in testers git issue branches would be great which are underways.

So in the mean time I use a sandbox for this. But how to get dreditor code into my repo?

  1. First create a sandbox on d.o. This gives to access to a new git repo.
  2. Ignore the initial git instructions
  3. Clone dreditor according the git instructions

    git clone http://git.drupal.org/project/dreditor.git

Using ctools modal forms for node edit

For a drupal 6 site I needed a node edit overlay. This is what I did.

Define the urls ajax/node/%node/edit and nojs/node/%node/edit. The idea is to use path similar to the normal drupal paths just prepended with what ctools modal needs. It needs are minor in that the url path must contain a string nojs and in this case a class attribute ctools-use-modal.

<?php
function annotate_ym_menu() {
$items['nojs/node/%node/%'] = array(
'page callback' => 'annotate_ym_ajax_node',
'page arguments' => array(0, 2, 3),

I like Universal Subtitles website.

Logo of Universal Subtitles
I recently discovered the site http://universalsubtitles.org which is a gateway to online video material and allows us to subtitle online videos. In the past I tried to do something similar with http://mycaptions.org (offline) with an arcane editor using BUedit. With that system I managed to add subtitles to this video of which I like the animal.

Temporary Securing Drupal through Basic Auth in settings.php

We needed to protect our production site from prying eyes for a while with a basic authentication. Using apache basic auth settings seemed not enough. Or actually was too much. We wanted the theme to blend in. So these files were not supposed to get protected. Only our Drupal pages should.

The solution came from http://php.net/manual/en/features.http-auth.php. Adding the following to sites/default/settings.php makes the customer happy and drush too.

nationalise your site with enlisted variables

With drupal we can enable the locale module and install the i18n module to internationalise and translate our site we can make our hands dirty by visiting the http://build2be.com/admin/build/translate/search.

Still our work is not finished yet. We have to dive into settings.php to translate more strings of our site.

Taken from http://drupal.org/node/275705#comment-1058360 and using http://drupal.org/projects/drush_sm we learn we may choose from a lot of variables.