Category: Drupal
-
Race conditions and caching variables
I would like to claim an utter hatred of race conditions. This is where code is written in such a way that it doesn’t fully consider the possibility of another thread (e.g. another website hit) or threads occurring concurrently. Consider the following which has been increasingly frustrating me recently: Drupal…
-
Disabling all Drupal CSS files
We needed to disable all of Drupal’s CSS files from our theme. Here’s how we did it: function THEMENAME_preprocess(&$variables) { // Get rid of all of Drupal’s CSS files $css = drupal_add_css(); foreach ($css[‘all’][‘module’] as $file => $status) { if (!strstr($file, ‘modules/MYMODULE’)) { unset($css[‘all’][‘module’][$file]); …
-
Using less Drupal
Lately, I’ve had various frustrations with Drupal which have moved me away from using it for various things. I’d like to go through where I’ve moved away from Drupal, why I’ve made those changes, and my future Drupal decisions. WordPress rather than Drupal blog To begin with, this blog is…
-
Debug live errors more easily with debug_backtrace() output in error messages
Tailing my error log, I kept coming across annoying errors like this: [Mon Nov 13 21:14:49 2006] [error] [client xx.xxx.xxx.xxx] PHP Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /path/to/drupal/includes/database.mysql.inc on line 350, referer: http://www.example.com/node/1234/edit No matter how hard I tried, I couldn’t reproduce the errors locally,…
-
Drupal Community Yearbook
In our effort to give something back to Drupal (the fantastic open source content management framework at the core of AllYearbooks), we’re aiming to make a physical yearbook for members of the worldwide Drupal community. Presuming all goes to plan and enough people join, the idea is to produce physical…