Working from the Road

This next week I'll be taking my show on the road. After a high school friend's wedding this evening, I'm driving with Christina to Abingdon, VA where we'll stay with my grandparents for the weekend. We'll be meeting my older brother and sister-in-law there for some hangin' out and some play action - The Fantasticks at the local Barter Theatre. It should be a fun weekend!

On Sunday evening or Monday morning we'll drive down to Greenville, SC where I'll set up shop in their "bonus room". It'll become my new home office for a few days while we spend the evenings visiting with family and loading up on baby shower loot. I love spending time with my in-laws, so the week should be a real treat.

Even better... we won't have to leave our house unattended that whole time! Some friends are in between leases at two apartments and have agreed to come babysit Top Porch and our awesome veggie garden while we're away. Sheets changed, clean towels out, floor vacuumed, and chocolates hidden. Hah!

Faster module development thanks to Schema

For some time now, my standard operating procedure for writing new modules to client specifications has included a tedious conversion of database tables into schema arrays for use in each module's install file. Usually, I'd begin with copying and pasting into the install file a schema array I'd used elsewhere, and I would modify that array to match up to the table I had thrown together to store the module's data while testing. I would then have to go through the process of uninstalling and re-installing my module to make sure I didn't mess up the schema somewhere.

Lo and behold, at the end of May I learned about the <a href="">Schema</a> module at an event where <em>I</em> was supposed to be the instructor. <img src=" /> I must have missed this somewhere along the way when converting all my code to Drupal 6, but it sure does make new module development a lot easier!

The Schema module offers several features for examining the tables in your site's database and comparing them with the schema data defined in your site's module install files. If you use it for a full inspection of your site's database, any table it finds that does not have a matching schema array will be listed on the page with a schema array already built for you. It even includes little placeholders where you should insert table and field descriptions. <img src="" />

So, now with the Schema module, I can copy and paste the auto generated schema array into my install files, making module development <em>that</em> much faster. I'm really digging it. One pitfall that you should be aware of: if you're using <b>drupal_write_record()</b> to insert and update rows in these new database tables, you must copy the schema arrays into your module's <b>hook_schema()</b> <em>before</em> it will work. If <b>drupal_write_record()</b> can't find the schema array for the table to which you want to write the record, it will not be able to construct the insert or update query properly. Remember to clear your cache (by visiting the modules page, for example) before testing it so Drupal can rebuild the cached schema data.

I hope it makes your life easier, too! Many thanks to Barry and the other Schema maintainer(s).

Commerce Guys Drupal / Ubercart Training Underway

It's now pushing 3 AM, so I guess that means Day 1 of our training in Chicago has officially been over for a little while. No matter, I'm just winding down and figured I'd report on how things are going! The folks in attendance are all awesome and bring a lot to the table in terms of experience and personality. It's a treat to have each of them here, and I look forward to the next two days of training.

Basically, our time together hasn't been without its hiccups (our server slowed to a crawl when we instructed everyone to visit the modules page at the same time... oops ), but for the most part it was a good day of introductions, hopefully very fruitful for the newcomers to Drupal and Ubercart, and a fun way to meet more experienced Drupallers looking to bone up their Ubercart knowledge.

Today we managed to cover most of the basics, from an installation through setting up a store catalog with images, product classes, attributes, and the core catalog module. I covered the sessions related to the Catalog and Attributes systems and hope to distill that information into some articles before I forget everything I said. Lol

The day has also been quite tasty. I had a hearty salad at Whole Foods for lunch (Dear wife, I even voluntarily put raisins on it!) with 5 other guys from the training. For dinner we met up with some Palantiri at Hub 51 where I got an awesomely fat and juicy burger with fries. I got to rub shoulders with Larry Garfield and refine my understanding of things like handlers, OOP in Drupal, and models of time travel in Star Trek. After that it was back to the hotel to relax and get work done porting the UC Store Credit module and UC Free Order to Drupal 6 for use on Ubercart 2.x. Give 'em a shot!

Now the day is way past the close for me, so I'll hit the sack and do it all again tomorrow.

New Book Search Module for Drupal 6 Released

I just released the <a href="">Book Search</a> module for Drupal 6. I already told my wife how excited I was about the project, as everything fell into place quickly and effectively. I'm one of those oddballs who views his coding as an art, and I love the sense of accomplishment that I get from turning a blank file into a well-styled, commented, feature complete module all in one sitting.

The module adds a book search tab to the search form and allows your users to perform simple keyword searches through specific books on your site. As an administrator, you decide which books should be available for search through the book search form, and the user can specify to search any of these books or a select few. The module also defines a book search block that appears when users are view pages from searchable books. The form redirects to the book search form upon submission.

One enhancement over the core advanced content search is the fact that I'm persisting the book search options between searches. The core advanced content search turns your parameters into special keywords that then persist in the actual search keywords textfield. Huh? What gives? This module will simply set the defaults for the book search options based on the path and remove them from the keywords in the search keywords textfield. Perhaps this has already been fixed for D7, but if not, someone should prod me until I submit a patch for that.

From conception to release, Book Search took about 3.25 hours, keeping me above my target 100 lines of code per hour. I can't say with absolute certainty, but I'm sure the Mountain Dew I had over lunch before diving into the code had something to do with the speedy development. <img src="" alt="Wink" />

The module was developed for a friend and client named <a href="">Bill Mounce</a> who operates <a href="">Biblical Training</a>, a website that offers free seminary level courses online from some of my favorite Evangelical teachers and preachers. He'll also get use out of the module on <a href="">Kids' Greek</a>, where he's developing online curriculum to teach biblical Greek (targeted at kids and homeschoolers, but obviously awesome for everyone). Bill chaired the translation of the New Testament in the <a href="">English Standard Version</a> of the Bible, and he keeps an <a href="">awesome blog</a> that discusses various issues in translation (both academic and practical) and Christian ministry. I highly recommend it!

I love it when my work and personal life interests collide. I hope others get some good use out of the result, as well! <img src="" alt="Cool" />