My Patch Got Rejected OR an Abrupt Introduction to Drupal's Localization Features
I recently had a client complain to me about the wording of one of their site's error pages. If a user went to user/<user id>/fbconnect and their account wasn't linked to a facebook account then they get an error message. Problem is the original wording of the message (while perfectly clear to me) was confusing the hell of of this guy's userbase. (Note: this message was removed from later versions of the module.)
So, this being the case I dutifully crawled into the guts of the Facebook Connect module and figured out where the message was being created. A quick and dirty hook_menu_alter() and a few lines of wrapper function later I had the text changed to what the client wanted.
After pondering on this for a while I came to the conclusion that while this was effective it was also a dirty hack, so I decided to roll a patch for Facebook Connect that makes this message a configurable option in the admin interface. What can I say, it seemed like a good idea at the time.
Rejection
As you can see, my patch was given the boot by the module maintainer. Oh well, these things happen I suppose. In retrospect submitting a lame module patch because one client complained wasn't such a hot idea anyway.
I don't blame the maintainer for rejecting it, I just wish someone had pointed out the glaring holes in my understanding of core that it pointed out.
I figured I'd let it go at that but still had this nagging sense that there was one more dirty hack in the world because of me and there had to be a better way.
Enter stage right, a better way
It turns out my initial approach (hook_menu_alter + wrapper) represents going about this the hard way. Not only will the Locale module in core handle stuff like this, it turns out it it isn't even necessary: simple string substitution is now supported in core.
*facepalm* A minor edit in settings.php would have sorted all of this. Ah well, live and learn.
- freeman's blog
- Login or register to post comments
