Computery

Stop MySQL giving up on Drupal

Tags: 

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

Tags: 

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.

Unfortunately I wasn't able to get far, it turned out that there was a problem in the D6 port which causes an "Access Denied" error when you actually submit the form to begin the conversion. Not to be undone, I started poking around the script and discovered that the menu configuration was using an older format than what the current Drupal release (v6.4) required. A few quick lines later and I was able to get it working again.

In the interests of helping the community I've compiled the changes into a patch file:

There are still a bunch of syntax errors that will show up after the data has converted, but at least it will actually convert the data over. Also, I made some minor tweaks to the code according to the Drupal development guidelines based on what the coder module recommended. Lastly, be warned that the patch was created using git, so it may be easier to just add the few missing "access" lines manually.

One solution for "unexpected T_SR" errors in PHP

Tags: 

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.

Drupal imagecache setup on OSX

Tags: 

As mentioned before, PHP is misconfigured on OSX and you don't get their customized sourcecode in order to recompile it with the options you need. As such you can't run the GD plugin which is what most OSS programs use for image processing, and is generally the most recommended way of doing it. For Drupal's ImageCache / ImageAPI module(s) what you can do instead is install the ImageMagick package and then just tell Drupal to use the ImageAPI-ImageMagick module instead of the GD one. I've already got ImageMagick installed on my McBook for Rails use so it was only a few seconds to get it going for Drupal too.

Why Trac sucks

Tags: 

Reasons to use Trac:

  • It has been around for ages so it's pretty well known.
  • It works with Subversion.
  • Built-in Wiki.
  • The milestones system works fairly well.

Why Trac sucks, IMHO of course:

  • It's written in Python, a language I currently don't know nor have a (current) inclination to learn.
  • It doesn't do git without a plugin.
  • How do I get email notifications when something's changed in the wiki?
  • How do I get email notifications when code changes are uploaded?
  • Each project you want to manage with it gets its own separate install, which is very klunky. You have to log into each one separately (unless you set up a shared authentication system of some sort in the web server).
  • Each project only gets one repository.
  • The interface is klunky, e.g. clicking View Tickets brings you to a page where you first have to choose your filter rather than just loading the last one used or a default.
  • No task associations so you can't do a parent-child dependency to indicate a completion hierarchy.
  • The interface should allow for trag-n-drop changing of priorities.
  • It isn't github or unfuddle or Redmine :)

Personally I recommend github for public projects where you don't need task management (I don't like Lighthouse), Unfuddle for closed projects or where you want good task management for your open project, or Redmine if you want full control and to host it all yourself.

Just thought I'd share that.

Pages

Subscribe to Computery