Drupal makes "An illegal choice"

Here's a weird one. Have a content type with about forty fields. When I click Preview on an empty form it gives the error "An illegal choice has been detected. Please contact the site administrator." which you're sure to agree is not terribly useful. I took a look at the watchdog logs and saw that the field throwing the error is a required integer checkbox that had no items selected. So instead of saying "You must select one of the items" it says "sir you are a smeghead" - not very useful, Drupal.


Stop MySQL giving up on Drupal

With Drupal, if you have a content type with lots of records you can run into a problem where you start getting lots of "server has gone away" errors from MySQL. This stems from queries getting too long and MySQL giving up before the query has finished loading. So, to fix it, just edit your my.ini or my.cnf file to add the following line to the [mysqld] section:

  • max_allowed_packet=24M

There are other settings that can make a difference too, but this seems to be a good starting point.


Patch for wp2drupal for Drupal 6

I'm trying to migrate one of my personal sites from Wordpress to Drupal and needed a way to migrate the existing data. Well, it turned out to be a little tricky as I'm using Drupal 6 while the only really useful converter, wp2drupal, was written for Drupal 5. Luckily someone converted wp2drupal to D6, so away I went.


One solution for "unexpected T_SR" errors in PHP

Here's a little tidbit. If you ever get "Parse error: syntax error, unexpected T_SR" errors in PHP, check to see if you had any svn merge conflicts. This error raised its ugle head this evening for me and that's exactly what it turned out to be. Then just bounce over to your svn client of choice, fix the conflict (or just delete the offending files and grab the latest file again), and the error will disappear.



Subscribe to Computery