Saturday, December 06, 2008

Always check for off-by-one errors

I just ran into a pretty basic error using a Drupal module, one that lets you post repeating events. Of course I just saw taht there was a release update and just threw it on the CHANCES Family Centre site I was working on without re-testing it. It wasn't until one of the site administrators tried to create a weekly repeating event and fortunately went to check the results that she saw there was a problem -- subsequent instances of a new event were appearing one day early in the week. This is a classic off-by-one error that every programmer on earth has made more than once in their time. ("Wait, should that less than check be a less than or equal to?")

Unfortunately when something strange happens many users think that it's a problem with something thy did and they just don't understand this big complex piece of software and they never will get the hang of it and blah blah blah. And of course no user of a site should be expected to go to a module's drupal.org page and look at the open issues to see if anyone else is having the problem. My take-home from this is to be very wary of software module updates, and to not just trust something because it is an official release of a module.

Fortunately I have a good relationship with this particular client and was happy to put in a fix for them without too much trouble, instead of them just trying to muddle through posting events one day off intentionally, which is what users of commercial software that has a bug in it would have to do.

The classic double-edged sword of open source software development, a developer might be working on a bit of code to suit his own needs, and just not do enough diligent checks that he hasn't broken some other feature unintentionally. Drupal is finally getting into active automated testing, but this won't help you if you are using a module that isn't part of the mainstream set of actively-developed modules. Maybe all this is telling me to take up the mantle of contributing in more active and complete ways to keep the modules I want to use alive.

The slow hard but rewarding lesson of Open Source.

Labels: , , ,

By al - 3:58 p.m. | (0) comments | Post a Comment

Wednesday, August 27, 2008

DrupalSN joins Russia in recognizing Abkhazian independence

DrupalSN BadgeI just signed up for an account at the new site DrupalSN.com, a Drupal-based social networking site for Drupal developers, and I was pretty impressed to see how quickly the site had moved to recognize the independence of that bit of dirt between Russia and Georgia named Abkhazia.



My trivia-nerd self is very interested in the fact that if more bodies do recognize Abkhazia that it will gain the fame of being alphabetically the first country in every list. Expect inflated numbers of internet users from there thanks to me picking it when signing up for sites I don't want to have my personal info. I scrolled down and saw they have South Ossetia, too. I should create an account and pretend to be from Georgia and do some trolling, on such a brand new site it would surely get some attention.

As for the site itself, it looks like it has some potential for showing off some of the social features of Drupal, hopefully they will share their tips on making it look nice and smooth and not hacked together like a lot of drupal sites seem to be, with way too many modules and rough edges around the themes. Maybe they could build a module for partial matching of user names that's smoother than drupal's current implementation that only lets you search by username and not real name.

I've been doing a lot of work in Drupal lately both on my own and for my new job, so I'll be keeping pretty close tabs on the latest developments in the Drupal world, crossing my fingers that some of the more annoying parts of it get ironed out.

Labels: ,

By al - 6:53 p.m. | (0) comments | Post a Comment

Tuesday, August 14, 2007

PHP and Drupal

I'm no PHP expert, but I submitted my first solution to the drupal.org user support site today, which is pretty neat. Link. (scroll to the bottom - to Update #6.)

The fix gets the timezone to display properly when making a list of upcoming events in a drupal events sidebar.  I implemented it so that it followed the proper date format as specified in the site settings, rather than the default setting which was just a number representing the number of days until the event, which I don't find very useful.

I sometimes forget how great it is to work with open-source tools, since you can fix anything yourself.  On the other hand, a properly tested commercial API never would have gone out the door like that.  Stupid catch-22s.  At least it doesn't cost me anything. :)

Labels: , ,

By al - 1:58 a.m. | (1) comments | Post a Comment

    follow me on Twitter

    al's del.icio.us Links

    • www.flickr.com
      This is a Flickr badge showing public photos from dragonofsea. Make you own badge here.
    •  
    • (al)



    • Powered by Blogger