by in Developer Notes Featured

In the course of developing custom code for websites, we often write programs to work with established open source content management software, such as Drupal and WordPress. One of the tenets of open source is the idea of giving back to the community of developers who work with the software by contributing code back to the larger project. I happen to have some Drupal code that I know other folks would find useful, so I’m going about to process to provide this in the form of a new “module.”

It turns out, it’s not so easy to give things away as I might have thought! There is a whole process for creating a “project” to house a “module” in Drupal. This includes a combination of vetting your code, coercing you to vet other candidate projects, and a lot of waiting around. While it is a bit onerous, I’ve reaped a lot of benefit from the process which I will share, but let me start with an introduction to my module, “Commerce Cart Multiple.”

Commerce Cart Multiple is a module that provides a means of managing multiple “shopping carts” in and e-commerce site. Typically, a user has access to a singular “shopping cart” which serves as a running list of items she wants to purchase. It follows her around as she visits different pages of the site as she “adds” items, assembling her order. Once she has gathered her items, she would proceed to “checkout” and complete the shipping and billing details of her order.

Commerce Cart Multiple Screen Main Commerce Cart Multiple screen showing available carts and actions.

By allowing users to switch between multiple shopping carts, Commerce Cart Module solves a problem where a user needs to assemble multiple orders at the same time. This is the case for salespeople and dealers of our client, Massarelli’s Fountains and Garden Accents, and I wrote a custom module that provides the logic and user interface elements to accomplish this. Seeing that other developers were facing the same challenge, I thought it would be a good candidate for a new Drupal project.

Thus far, creating a new Drupal project has included several steps, including preparing the code for submission and responding to code reviews from other Drupal users. Also, in order to speed the period of review for my project, I’ve contributed reviews to other candidate projects. Overall, it has been a very fruitful process, where I’ve learned new tools, techniques and perspectives for software development.

For tools, I’ve learned a bit more for working with Git, which is software used for managing ongoing changes to a piece of software. Git tracks and summarizes your ongoing work, allowing you to easily create iterations of your code and merge changes into a larger whole. It allows you to revert back to prior versions and can even allow multiple developers to work at the same time.

Another tool is Coder, which automatically reviews your code against Drupal “coding standards” (which include both formatting and inline documentation criteria). While nitpicky, there is great value in producing code that follows predictable models and is easier read and work with.

I’ve also gained the experience of having my code critiqued, as well as evaluating other developers code. In order to speed a burdened project application process, Drupal encourages developers submitting projects to review other projects in the pipeline in order give their project priority for review. In participating in other reviews, I was able to help other developers improve their projects. One key point I learned is that it is easy to take being a native English speaker for granted! These other developers I’ve worked with have not only had to write code, but also work a lot in English, with which they have had varying proficiency. As a result, there is an ongoing opportunity to help other developers in the areas of documentation and phrasing of titles and other interface elements.

Commerce Cart Multiple has completed its code review and is now waiting for an administrator to elevate it to a full project. Thus, the final lesson I have learned; patience! However, taken what I have learned as a whole, and understanding volunteer efforts take time, I’m glad I’ve gone to the trouble of contributing. Sometimes it’s what you learn from a process that is most important.

One Response to “Thoughts on creating a software project for the Drupal content management framework”

  1. Inforest Communications releases Commerce Cart Multiple module, recognized as Drupal Service Provider | Inforest Communications | Princeton NJ Web Design Firm

    […] Initially developed to support the needs of one client, Commerce Cart Multiple was contributed within the spirit of the shared, volunteer directed Drupal content management framework. In order to be considered a full contributed project, the code went through a extensive review process where it was vetted by other Drupal developers. Our experience with this process is detailed in our earlier post. […]

Leave a Reply

You must be logged in to post a comment.

About Dana Hutchins

Dana is founder of Inforest Communications and has over fifteen years of Web design and development experience. Dana is involved in all aspects of business development and marketing of the firm, including serving as primary consultant on Internet and Web strategy to Inforest clients. His Web development responsibilities are primarily focused on writing custom modules,themes and plugins to make Drupal and WordPress sites run and look better. He also writes custom Web applications that have been used in online calendaring, e­-commerce and surveys.

Dana’s favorite programming acronyms are PHP, MySQL, CSS3, HTML5 and jQuery. However, what really gets him excited is the opportunity to use these tools to build Web sites that solve business needs and create new opportunities for his clients.