Tag Archive for drupal

From FUpload to SWFUpload

Community contributed extensions are a double-edged sword in the free, open-source software world. On the one hand, the user community creates and maintains hundreds of modules for a web application that is free to download and install. A for-profit company could never create such an expansive set of plugins on their own. On the other hand, volunteer commitment to a module can wane over time.

An upgrade to PHP version 5.3 broke our Drupal 6 Image FUpload plug-in. Apparently, this problem was discovered two years ago and has not yet been entirely fixed. Not coincidentally, the Image FUpload project is seeking a new maintainer.

Fortunately, the SWFUpload project is in better shape, so we switched to it this weekend. Project usage statistics confirm that at least a thousand other site managers have made the same decision.

Both modules rely on the same SWFUpload Google project, so they operate in similar fashion. SWFUpload seems simpler and behaves more consistently than Image FUpload. Previously uploaded photo gallery images are stored and presented by ImageField and FileField, so past photo galleries do not depend on the choice of uploader.

What batch image uploader will be available for Drupal 7? Neither Image FUpload nor SWFUpload has a Drupal 7 version in development. FileField is now integrated into Drupal 7 core, so perhaps a partial rewrite is required for one of these modules to advance to D7.

Many thanks to Drupal community developers for your work. This project would not be possible without you. If you are interested in automatically creating Drupal users based on LDAP accounts, check out my contribution to the LDAPsync module.

Mobile Theme: WordPress vs. Drupal

How to enable a mobile them in WordPress

Install WPTouch. Congratulations, you are done! You automatically get a cleanly designed theme with dynamic drop-downs, a comment counter per post, and “mobile theme” toggle at the bottom.


How to enable a mobile theme in Drupal

Research various approaches. I decided go with the mobile theme option.

Select the most stable, current modules to support your approach, in my case Mobile Tools and Browscap.

Select a mobile theme. I have tested a number: A Cloudy Day, Adaptive Theme Mobile, Fusion Mobile, iUi, iWebKit, Mobile jQuery (not to be confused with jQuery Mobile), and Nokia Mobile.

Realize that these themes are pretty bare out of the box, and you have a lot of custom theming in your future!


A Cloudy Day


Fusion Mobile


Mobile jQuery


What is the problem?

I understand that it is easier to develop a mobile theme plug-in for WordPress, because content is managed in just one way. You have pages and posts, and a mobile theme just needs to organize them. Our Drupal site has many custom content types, views, blocks, and regions, and no mobile theme is going to automatically display them correctly out of the box. However, I had expected the theme designs themselves to be more mature than this.

I also find it totally unclear how to modify regions and block visibility in our Drupal site for the mobile theme. In our single-theme Drupal site, the theme template controls when and where certain regions exist, and the block system determines when to display block content within page regions. I want to organize the home page completely differently for the mobile theme, but now I have to learn how to define page regions and block visibility separately for the mobile theme. I will try to create a home page template in my new theme with unique regions and block content, but something tells me that this will not be easy. Or I could install modules to make display configuration more dynamic, but I do not want to add performance overhead for our non-mobile users.

Dear Drupal Themers

If you would like to submit a modest proposal for mobile theme development, please write me at kassissiehr (at) catlin.edu.

3,700,000 Session Records

Hey, Drupal fans! I would like to alert you to an issue that I encountered today. While doing some unrelated database work, I found that our sessions table had grown to over 3,700,000 records. While not posing any immediate danger to the website, this may have been slowing down backup and just isn’t tidy. Drupal relies on PHP garbage collection to cleanup session tables, but apparently this does not happen properly on Debian systems. Solutions include setting PHP defaults to encourage garbage collection and installing the Session Expire module. The problem is fixed in Drupal 7 through php.ini overrides.

I chose to install Session Expire on our Drupal 6 site, feeling that Drupal should clean up its own garbage. It also has the advantage of providing a choice between deleting anonymous sessions, authenticated user sessions, or both. The module is extremely simple and could be implemented on a Drupal 7 site if one would prefer to delete old sessions that way. The module took an hour to delete 3.7m records on a test copy of our site. You might prefer to just truncate the table instead, though this will log off people currently using the site.

Spot the Application Deadline

I’d like to think that our new online application system helped encourage families to apply for admission. Y-axis numbers removed intentionally.

Taleo Recruitment System

Let it not be said that I always choose the do-it-yourself solution! Our new Taleo recruitment (job application) system has been terrific so far, feature-rich, easy to use, well-integrated with our website, and one-third of the cost of our previous recruiting website. Their system permits a HTML wrapper, which we populate with our own site template code to make it look like the rest of the site.

To facilitate integration, we use Drupal’s built-in aggregator module to display currently open positions on the top-level employment web page and include them within search.

Teachers Building Classroom Web Pages

Catlin Gabel Lower School teachers are building up their classroom web pages. Since the teachers have different proficiency levels, we require a common baseline for web page content and then offer choices for what else to include. The following “menu” serves as a guide to plan web page improvements. Teachers select the content they would like to include and then use the website tools, with tech support present to assist.

Download classroom website ideas (.docx format)

One Year Old

The Catlin Gabel website recently turned one! After a gestation period of six months, the website launched on July 1, 2009.

The Drupal-based website held up well last year. Dedicated hardware helped ensure that performance would remain high. The site received high ratings for usability. We improved the site throughout the year in response to user feedback and continue to develop it now.

Drupal 6 itself matured over the course of the year. Code and SQL errors resolved themselves as the community released patches and we installed the updated versions.

The year validated our decision to integrate password-protected, community content throughout the site. When logged in, users access protected content and tools based on their group membership. Users get to these tools in their expected locations on the site, rather than having to enter a separate community portal.

This year, we plan to build a complete online admission application, improve the design of section landing pages, and make a lot of small features more usable.

Drupal 6.17 and session cookies

I have had no problems with Drupal core updates for years. I finally got burned when I installed Drupal 6.17. This update no longer removes “www.” from admin-set cookie domains, which was preventing admins from using different cookie domains for www.example.com and example.com websites. The change broke login for many of our users until I solved the problem.

How did this seemingly esoteric issue affect us? In addition to www.catlin.edu, we also run live development and test copies of our website, so that we may build new features and try changes without affecting users. Some time ago, we manually set $cookie_domain in settings.php so that sites could have separate cookies, allowing a developer to log into the different sites as different users. However, users had saved cookies that used the old method, which introduced a cookie mismatch when they visited www.catlin.edu and had a saved cookie for catlin.edu. I still don’t understand why the browser didn’t just save a new cookie when they logged in instead of silently failing.

Clearing cookies resolved the problem for individual users, but I needed a solution that would work for off-campus users with saved cookies. Ultimately, I followed the release announcement and set $cookie_domain to “.catlin.edu” so that it would work whether the user’s saved cookie was for www.catlin.edu or .catlin.edu. It also means that developers are automatically logged into our development and test sites, but we can always use a separate browser when needed.

The site log showed no errors, but one could see a series of “new session for user …” entries when a user was having problems logging in. The normal behavior is that the user successfully opens a new session then either ends the session soon thereafter or leaves it open.

More student work online

Classes, global travel groups, and individuals are publishing on the Catlin Gabel website to share their work with the Catlin Gabel community or other specific audiences. Learning objectives vary on these blogs from building community awareness to communicating directly to specific stakeholders.

Any student, teacher, or staff member can maintain an individual blog or contribute to a group blog on the Catlin Gabel website. Some blogs are open to everyone visiting our website. Most blog posts require login.

You can always find blogs from the Quick Links menu on the Catlin Gabel website. Happy reading!

» Link to all blogs

Links to specific blogs

Nepal 2010
Japan 2010
Cuba 2010
Senior Projects

Urban Studies

Honors Art Seminar
Science Projects
Spanish V Honors
French 2

External blogs
Paul Monheimer in Israel
The Catlin Coverslip

Classroom pages
Middle and Lower School teachers use classroom pages more often than student blogs. The function is similar.
Second grade
Fourth grade

Fifth grade

Sixth grade
Lower School French

Seventh grade

Summer Programs Registration

Last year, I built a site to allow parents to register their children for Catlin Gabel’s summer camps. This helped our small staff more easily handle hundreds of registrations each spring and provides our parents with immediate feedback for their summer plans. This year, I incorporated this into our new website by rebuilding the features using the same technique. The site had to include courses from a print catalog, accept credit card transactions, enforce enrollment limits, record student information, and new this year, require a complete medical release form as part of registration

This technique relies on just four modules: Ubercart, CCK, Views, and Webform, three of which I was already using widely throughout the site. Although I was worried about the increased load of installing Ubercart on our site, I found through testing that RAM use and page load time did not differ significantly between a copy of site that included Ubercart and a copy that did not.

Summer Course is a custom Ubercart product type, which creates a new custom content type to which one may add fields. I added select lists for grade and session (week). I chose not to use taxonomy for this, because I would have more control over the display of CCK fields in the node editing form, and because these value lists only apply to this one content type.

One view presents users with the main list of summer course offerings, offering both a link directly to the detailed course description and a button to purchase immediately if you know already the courses you want to choose. Exposed filters allow one to limit the list to certain grades or weeks. I display the Ubercart-supplied shopping cart block on this page.

The cart and checkout processes are very standard. Users review their cart and then move to complete checkout. I bought a monthly subscription to PayPal Website Payments Pro, so that our website could send purchase information directly to PayPal and receive an immediately reply, without the user leaving our site. We use PayPal’s admin interface to transfer funds to the school’s bank account and issue refunds. As an added benefit, we do not store any credit card information on our servers. In order to make another feature possible (see below), I require the user to log in to access checkout.

I combined student information and medical release into one form. I could have built the form in a custom module, but I chose to use Webform in order to save time and make it easier for others to modify the form in the future. I route parents from the Ubercart screen to the webform and then route them back to checkout by setting the webform’s “thank you” page to /cart/checkout.

I wrote a custom Ubercart module to add a “student information and medical release” panel to the checkout screen. This is done by invoking hook_checkout_pane in my module. To require the completion of this form, my custom pane creates a select list showing all of the medical release webforms that the user has created on the site. Since the medical form also contains the student information, the user has to complete one for each student she wishes to register. Completing the form makes student names appear in the required select field.

The custom module saves the submitted webform id in a custom database table, linking each course registration to a specified student. A couple more custom functions hook into the checkout review and invoice panes, displaying the student’s information through the rest of the checkout and confirmation process.

A second custom module allows our staff to export orders from the system for reconciliation with any paper orders received and the billing process. I prefer not to have the website handle too many of the back-office functions of the program, since it would take so much additional effort to include accounting reconciliation and other administrative features that only a few school staff members will use. The website is primarily for the many end-users who will sign up for courses.

The Ubercart “stock” feature allows us to limit online enrollment for popular classes, so that the website does not unwittingly facilitate over-subscription.

A little CSS and theme work lines up the Grades field values in a row and arranges some webform sections side-by-side.

Ubercart offers just about everything we need out of the box, provides a framework for adding some features, and keeps this important tool within our main website.