404 foolishness

I finally bothered to get to the bottom of a behaviour I'd noticed some time ago but never investigated. When showing a 404 page, custom or otherwise, Drupal 5.x (and now Drupal 6.x too) does not render any blocks. Not only does this drop your user in to no-man's land on your site, but it also breaks some layouts too, depending on your theme.

There has been a load of debate about this, culminating in the creation of this (broken, btw - I made a new one) patch:http://drupal.org/node/141162

The solution is simple - even more simple than this patch. Find these lines in common.inc:

That's all there is to it. Now your 404 page will render blocks again, presuming you have any switched on for the page concerned.

As you can see from the accompanying comment, the reason the Drupal core developers decided to impose this lack of blocks on everyone is because they feel allocating unnecessary processing to an error page is a waste of system resources. They cite examples where the 404 page is hit millions of times in a month.

Fine, so you get hit a lot. But I say simply disabling blocks on the 404 page is the lamest and laziest way of dealing with the performance issue. You're not DEALING WITH THE ISSUE. You're just hiding it and buying yourself a little more time.

Guys, that just SUCKS. Sheesh, what were they thinking? What's worse is most of the core developers still seem to think this is a good idea. Fortunately a compromise has been forged for Drupal 7. So we only have two years of patching Drupal 6.x ahead of us. Doh!!

We’re Code Enigma

We’re one of the most experienced Drupal teams in Europe, best known for our work on large, technically challenging projects for all kinds of clients.

Our team is passionate about Drupal and open source software. Our whole company spends at least four weeks per year working on Drupal modules or other open source projects. We’re also strongly committed to putting design first, taking a mobile-first, content-out approach to creating websites. This ensures that the sites we build combine the power of Drupal with best practice design and development.