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

MySQL UPDATE and Drupal 7

Submitted by nk on Mon, 2010-08-23 12:31

Let's say you have an UPDATE query which uses old values to calculate new ones. The best example for now is swapping two columns: UPDATE table SET f1 = f2, f2 = f1. There is one SQL engine as far as I am aware where this breaks: MySQL (it works on PostgreSQL, SQLite and MS SQL). On MySQL, f1 and f2 both will have the old value of f2 instead of swapping.

So where is Drupal 7

Submitted by nk on Sat, 2010-08-21 19:21

While Drupal 7 has been quite long in the making, it's going to be very different from every release before: we have added tests that make sure core works well. (BTW it took quite some time to write so many of them!) This allows the core developers to focus their attention on deeper problems which are much, much harder to fix. Instead of "OMG node preview is broken!" we now contemplate "you know, this new File API is great, but it won't work well with Amazon S3 because..."

OOP and PHP or why Drupal rocks and some mistakes

Submitted by nk on Tue, 2010-08-17 06:28

Everyone knows I am not too fond of OOP. And yet, I had some role in crafting DBTNG. I now admit: DBTNG in its current implementation is a mistake. Making the stream wrappers a class -- although PHP mandates that -- is a mistake.

Drupal and Java (we want to be friends with Enterprise, right?)

Submitted by nk on Mon, 2010-08-16 23:57

Drupal 7 might work with Java databases. Eventually, we might even be able to run Drupal 7 on Google App Engine.

Serving static content from a different domain in Drupal 7

Submitted by nk on Wed, 2010-08-11 19:14

We wanted to serve static content from a CDN -- but it's the same if you only want to move your static content to a different server. This is fairly well researched and done in Drupal 6, here is the Drupal 7 version. It seems that some theme stuff (like the favicon and the logo and probably unaggregated CSS/JS) is passed as Drupal paths into file_create_url while aggregated CSS and JS is served from public://. So we need to implement file_url_alter and override the getExternalUrl of the DrupalPublicWrapper class (thanks goes to Damien Tournoud for pointing out the latter):

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?

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.

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?

User login