The drop is always movingYou know that saying about standing on the shoulders of giants? Drupal is standing on a huge pile of midgetsAll content management systems suck, Drupal just happens to suck less.Popular open source software is more secure than unpopular open source software, because insecure software becomes unpopular fast. [That doesn't happen for proprietary software.]Drupal makes sandwiches happen.There is a module for that

To answer some trademark FUD

Submitted by nk on Sun, 2010-03-28 20:22

Somebody begun to "protest the Drupal Trademark policy [...] yet the policy requires sites, like this, to pay to use the trademarked name in various areas such as website domain names". Now, this not true. The trademark policy has been created with lots of feedback from the community and I for myself strongly support it, does allow free usage of the word Drupal if "You exclusively use the Drupal trademark to either extend or improve the Drupal software, or to encourage the use of the Drupal software (in short "foster the Drupal software"). So my blog is fine for example.

Becoming a Drupal coder: a wise career move

Submitted by nk on Sun, 2010-03-14 23:46

-- Please help getting the word out by reposting this for various programmer-but-not-Drupal lists groups etc.

Drupal 7 multistep node forms are easy

Submitted by nk on Mon, 2010-03-08 01:21

The bane of multistep node forms are validation errors. But Drupal 7 has a cure. Not nice but a cure.

Slap #access = FALSE on form elements you dont want to see in the current step and then set up the Next button with #limit_validation_errors set to the elements you are about to see. The Prev button should get an empty #limit_validation_errors. Should field validation errors bother you, you can nuke those in hook_field_attach_validate.


Multiple forms together

Submitted by nk on Sun, 2010-03-07 02:45

I have written a Drupal 7 module which allows you to put together any number of forms into one <form>. For example, if you have a professor with various titles and you have created a title entity with the various fields necessary to describe that title then you can show all the title entity forms on the user edit form in a seamless manner. Co-maintainers are welcome.

VAAPI on Ubuntu Karmic Linux

Submitted by nk on Thu, 2010-02-25 21:07

I wanted to test VA API with my Lenovo T400s (GMA4500HD aka G45). You first need to install libva and then a libva-enabled mplayer. The only problem I have encountered is that the Debian package in the libva I downloaded disabled the i965 driver. I have reenabled it, it seems working. After installing, I found a small problem, reported on the Phoronix and the hkepc forums both: the skin of the people become blue. This can also be fixed easily.

Quickly navigating the deep directory structure

Submitted by nk on Mon, 2010-02-15 07:44

This works only on Linux:

chx@veyron:/var/www/drupal$ tail -3 /home/chx/.bashrc
function go() {
  cd `find . -type d -name $1`
chx@veyron:/var/www/drupal$ go views

Do not use github

Submitted by nk on Thu, 2010-02-04 11:24

If you use git then use gitorious or or anything that's not github. Reasons:

  1. github source code is not available. This makes me very uncomfortable. Who knows what might happen to the source code hosted there. I am not saying they will sneak in a backdoor but they could.

Rapidshare premium account download script

Submitted by nk on Tue, 2010-01-26 08:57

Although the web is full of scripts to help downloading from rapidshare with a premium account, none of them seemed to work for me. First, create a cookie file: curl -k -c .rapidshare -d 'login=USERID&password=PASSWORD' ''. In the browser first you click the "premium user" button, second you click "download". We download these pages because the first contains the number of the rapidshare server actually containing the file, like and then the mirror like rs123gc3 for Global Crossing.


Drupal 8: everything is pluggable

Submitted by nk on Sat, 2010-01-23 20:17

In previous Drupals we had a rough version of plugins -- you could load a cache plugin instead of but that was all. The pluggability was on file level and it only existed for very few files. Drupal 7 introduced many more pluggable subsystems and now the pluggability happens on a class level (mostly). We can plug in sessions, cache, queue, field storage, password hashing... Crell is working on unifying these for quite some time now. And this is all good, however, for Drupal 8 I would like to see a lot more.

Some Drupal 7 porting tips

Submitted by nk on Fri, 2010-01-22 08:32
  • UPDATE/INSERT often can be updated to a single db_merge.
  • Don't forget to ->execute() your db_select/db_insert/etc
  • Themes can have many variables and you might want to do
    function theme_fivestar_preview($variables) {
      $theme_definition = fivestar_theme();
      foreach ($theme_definition['fivestar_preview']['arguments'] as $key => $default) {
        $$key = $variables[$key];

    Edit: merlinofchaos suggests simply extract($variables, EXTR_SKIP); because that's what templates do.

User login