Barrett Olafson's Blog

You should follow us on twitter or subscribe to our RSS feed if you want to stay on top of all the latest.

barrett's picture

Trouble with Drupal, MySQL and non UTF-8 formats

I just figured out a fix for an annoyingly circuitous, tortuous, and baffling MySQL problem. I am not yet an expert of back-end system configuration, but I can tool around a bit (i.e. I know where the my.cnf, php.ini, etc. files live and when (mostly) to edit them). With that... Read More…

barrett's picture

Drupal 6 Theme Test-driver

Reading through the Weekly Drupal feed, I found a linked site that is pretty rad. Being primarily a developer, I am always interested in exploring the way the designer's side of Drupal. Besides helping me understand Drupal more fully and write more easily extensible code, its fun/cool to make sites look fun/cool. Read More…

barrett's picture

A Drupal version of chicken vs. egg: external API content fetching and cron failures

Recently we had an interesting issue with one of our multi-site Drupal deployments; the cron was not running regularly. Sifting through the logs showed that the cron seemed to be running extraordinarily long. After cron has been running for over an hour, Drupal would kill the 'cron_semaphore' variable, clear the cache and attempt to re-run cron. Cron would hang-up again, and the process would repeat itself into futile perpetuity. What was really occurring, was that the cron job had been failing due to an excessive response time from one of the external fetches the site was executing (e.g. feed aggregator, Brightcove hosted content, etc.). Read More…

barrett's picture

Drupal/AJAX: Exercise caution when using special foreign characters

I was recently working on a Brazilian Drupal 6.x site that uses CCK forms and needed some functionality to map a dropdown select list of states to another dropdown of cities in the chosen state, which I accomplished using a combination of the drupal_json function, as well as jQuery and AJAX, hooked into the drupal menu system. I learned how to use this functionality quite easily from Pro Drupal Development Chapter 17 - Using jQuery and have implemented it on a number of sites to date. Pro Drupal Development is definitely worth having as a desktop resource. Read More…

barrett's picture

Using PHP/MySQL w/Drupal to update missing Google Geocode data

We recently needed to fill missing geocode values in a project's database. Using some PHP magic and taking advantage of hook_cron() this is how we filled the missing values: /** * Implementation of hook_cron() * When the cron runs, try to resolve any locations that have a lat or lon = 0 */ function overmap_cron() { Read More…

barrett's picture

Autocomplete, clearing form values and Drupal form fields

Some browsers like to be helpful and help by remembering certain form fields. I was having a problem with Firefox auto-populating my some of my form fields (specifically field type 'password' and 'password_confirm') in a custom module I wrote. Read More…