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

DBTNG, array sorting and PHP crashfixes

Submitted by nk on Wed, 2010-08-04 20:55

One of our coders have pinged me that he is getting a weird error message "Warning: uksort(): Array was modified by the user comparison function". The array sort callback was doing a database query on the first run, stored the results and used that to sort. For sure it was not modifying the parent array. Fairly innocent, isn't it? Well, actually not. It turns out that last August a check was added to PHP 5.2 and 5.3 (released in 5.2.11 and 5.3.1) to verify that the array being sorted does not change, however debug_backtrace() fools this check. Guess what?

The iPad, the AmigaOne X1000 and the future of freedom

Submitted by nk on Thu, 2010-07-01 18:35

When I was a little kid, we had these eight bit home computers. To start anything you needed to type a BASIC command. The machine had a BASIC interpreter in it and came with a BASIC manual. If you had the smallest inclination towards programming, it was shockingly easy to go ahead and hack a program together. And then the BASIC interpreters have disappeared from the machines. The proliferation of GUIs made coding a little bit harder but still you could add something like Delphi to your Windows PC and hack ahead happily.

So why do I hate git?

Submitted by nk on Sun, 2010-06-20 16:11

One can copy-paste the mod_rewrite quotes from the Apache handbook pages verbatin just replacing mod_rewrite with git:

The great thing about git is it gives you all the configurability and flexibility of Sendmail. The downside to git is that it gives you all the configurability and flexibility of Sendmail.

Despite the tons of examples and docs, git is voodoo. Damned cool voodoo, but still voodoo.

Nokia Mail for Exchange invalid certificate

Submitted by nk on Tue, 2010-06-15 21:16

I was setting up push mail to when I got this message. The solution (brace yourself)

  1. openssl s_client -connect
  2. Copypaste the lines between and including -----BEGIN CERTIFICATE----- -----END CERTIFICATE----- to a .pem file
  3. openssl x509 -outform der -in certificate.pem -out certificate.der
  4. You need the whole trust chain, however, so in my case I needed the GlobalSign Root CA, which provides a DER file too
  5. Copy your der files to the phone

Doxygen standards

Submitted by nk on Tue, 2010-05-11 18:07

Please read the much evolved Doxygen standards. Common mistakes include forgetting a newline before @return, and function doc has to start with 3th person verb. Props to aspilicious for working tirelessly on fixing these errors and to jhodgdon our API documentation maintainer.

Put up or shut up

Submitted by nk on Sat, 2010-05-08 08:18

If you have not participated in core development then please do not write ill informed, baseless derisive blog posts and especially not to the Drupal Planet. Critique is good, baseless bashing just makes those who actually do the work feel depressed, angry and sad. I now abstain from reading the development list, the forums could we please keep at least the Planet a place which a developer can read without wanting to hit something? kthxbye

How to foster contribution?

Submitted by nk on Fri, 2010-04-30 19:38

I often lament that new Drupal community members are not like "old" and they are not contributing enough. But... do they have enough incentive and guidance? I go to, click download, gather everything I need to create a site, I can't see much asking for contributing. The Documentation top tab is better because that does ask but then again it's a bit of a "wall of a text" and people might just skip it. How can we better guide the newcomers to turn to contributors?

Pronunciation guide

Submitted by nk on Wed, 2010-04-14 17:27

So my name is Károly Négyesi and although I typically ask people to call me Charlie for simplicity they still try. So the challenge in Károly is the "ly" because most think that's a consonant and a wovel -- no, it's one consonant, like "j" in the beginning of York or yacht. For the á, check the city of Bath.

Moving hooks to the PHP5 era

Submitted by nk on Sun, 2010-04-11 04:30

Right now we have something like hook_user_logout which is documented in user.api.php and if mymodule wants to implement it then it needs to use a function called mymodule_user_logout. This is a Drupal convention and is not supported by any developer tool. We could instead have an interface called HookUserLogout with a single method called invoke which has the exact same signature and documentation as hook_user_logout. Edit: aside from IDE support, this would mean that PHP itself forces us to keep the hook signature. Invoking would happen through the registry table where we iterate over the classes implementing this interface. Of course, this would be cached but module_implements uses a cache in Drupal 7 already so not much change there. Code example is here, a skeleton of the invoker is here. The conversion would involve wrapping the function in a class, that's literally two lines of code including the } and renaming the function to invoke. The cost of creating a class vs calling a variable named function is not negligible but simply there are not enough on the page to make a measurable difference: 1000 calls are like 0.0025 vs 0.003 seconds.

MongoDB: what's to love (and what's not to)

Submitted by nk on Mon, 2010-03-29 18:34

Challenge: list the nodes of a user ordered by comment count. Sounds simple but the uid is stored in the node table and the comment count is in node_comment_statistics and beccause of that, this query can not be indexed and will therefore be always slow. Of course, you can begin to denormalize but do you want to keep a denormalized copy of your data for every kind of query? That's not a solution, that's a kludge and an ugly one.

User login