drupal planet

My Simple, but Nerve-Calming, drush Update Workflow

Just posted for my own reference - here's my workflow for updating a D6 (probably also D7) website using drush. Comprehensive information about all drush commands can be found on the http://drush.ws/ website. If you're not yet drinking the drush kool-aid, you need to—if you use a Linux server, of course.

  1. Visit admin/reports/updates page on your site, read through any relevant release notes for required updates (to check if there are special requirements for said update).
  2. $ drush @site pm-updatecode <module1_shortname> <module2_shortname> (add all modules to be updated)
  3. $ drush @site updatedb (updates the site database - update.php)
  4. $ drush @site cc all (clears all caches on the site)

The reason I do this manually, instead of running something like pm-update or pm-updatecode is that I like the granularity and security of doing all the updates discretely—especially when I'm updating a larger site, where I like to know exactly what's happening when I update.

Drupal Performance Guide - Drupal and the LAMP/LEMP stack

LAMP Stack with Drupal - Druplicon, Linux, Apache, MySQL, PHP

Drupal is a scalable, flexible, and open source content management system that is built to run on a variety of server architectures. The only real requirement is that PHP runs on your system. You can run Linux, Microsoft, Mac OS X, etc., along with Apache, IIS, nginx, MariaDB, MySQL, PostgreSQL, etc. if you're willing to do a few extra things.

However, the overwhelming majority of Drupal websites use the most popular LAMP stack on the backend: Linux, Apache, MySQL and PHP, or the 'LEMP' variation, with Nginx instead of Apache. This white paper (which is a living document – I'll be updating it as time progresses) provides my thoughts on performance considerations for Drupal on a LAMP stack, but this information can be used for pretty much any system on any server, if you look at the basic principles.

Sections:

Drupal.org approaching 1,000,000 nids!

I noticed a few months ago that we hit the mid-950,000 range for posts... since then, I've forgotten to mark down the numbers through time (I wanted to try plotting the exact day when we'd cross over to 1,000,000 posts).

Today (December 14), we were at node #998,346 (obviously, some nodes have been deleted, and database causes notwithstanding... but the count still advances!). Predictions as to when we'll hit this milestone? It'd be awesome if we could hit it exactly on the Drupal 7.0 release announcement, but I'm not holding my breath for that!

The better question is, "How many nodes can a drupal site have before the node table runs out of room (i.e. the nid column runs out of space?). The answer is 9,999,999,999 4,294,967,295 (as of Drupal version 7), and that, my friends, is a very large number. Of course, you could increase the length of that field (and related fields) on one of your sites to add more room, but I calculated it out, and it would take adding 10,000 new nodes every day for the next 2,740 ~1,200 years before you'd have to worry about hitting the nid limit!

Sending Recurring Emails to Thousands, using Simplenews as a Backend

I recently had a rather unique project requirement on one of my sites: I needed to send out a weekly email to hundreds (soon to be thousands) of site users, with the same template each week, but with the latest data from the website.

Basically, what I wanted to do was create a View on my site of the latest 10-12 items, and have that view be sent out to everyone (along with the views header/footer) in HTML (with a plain text alternative, of course), but I didn't want to have to create a new newsletter by hand each week to do this (this is something at which the Simplenews module excels... minus the automation).

After debating over whether I should write my own module to do the dirty work of sending out batches of emails, using modules like Views Send along with Rules and Views Bulk Operations, and some other crazy ideas, I finally found a potent combination for sending out automated weekly newsletters in a highly performant and optimal way, using the following modules:

  • Simplenews (for queuing/sending emails, managing subscriptions)
  • Rules (for scheduling the newsletters)
  • Elysia Cron (for easy cron scheduling and performance)
  • Views (to build the body of the newsletter)
  • Mime Mail (to send HTML emails, and to be able to easily have a custom email-friendly stylesheet)

I'm (almost) Drupal 7... and so should you!

I've now created three different Drupal 7 sites, and I can heartily state that I'm pleased with where the community has come in the past couple of years—especially from a UX perspective (the admin overlay has actually turned out to work VERY well across all the browsers I use). I will be posting more impressions of Drupal 7 from a themer's perspective in the coming weeks (check out an older post on D7 theming here).

I'm going to attempt an upgrade of this website to Drupal 7, then walk through creating a new D7 theme (hopefully to be contributed back) for this site.

Now that D7 has hit release candidate, a full release (1.0) can't be too far off, and nothing helps improve Drupal more than to start moving smaller production websites on shared hosting servers from 6.x to 7.x! The more people that do this, the more people can help fix the lingering bugs that are keeping Drupal 7 from more widespread adoption by those already using Drupal 6. You see... everyone benefits!

Drupal Simplenews: Automatically Subscribe New Users to a Newsletter

One of the sites I am setting up requires that all users be subscribed to a certain newsletter (or maybe two, depending on who they are) via Simplenews when they create their accounts (actually, their accounts are automatically created via LDAP... but that's another story).

Looking around, I found this post explaining how you might be able to auto-subscribe new users, and it led me to look up Simplenews' simplenews_subscribe_user() function.

Basically, you can add a line like the following in your custom module's hook_user() function, on the 'insert' $op (for Drupal 6):

Moving from Drupal 6 to Drupal 7 - A Themer's Perspective

The transition from Drupal 6 to Drupal 7 has taken a bit of time, and I (like many others) simply haven't had enough time in the past few months to do D7 testing while in the midst of tens of other D6 projects.

I've committed, though, to building out three Drupal sites in Drupal 7, now that we're at beta-3, and I will be posting a few reflections, mostly from a themer's perspective on some changes—the good, the bad, and the confusing.

A New Default Theme - Bartik

Just like Drupal 5/6's default theme, Garland (which is in use on this site right now :-/), Bartik will be seen on thousands of quickly-built sites around the web, and I think the theme is robust enough for this purpose. I'm actually building one site's theme directly on top of Bartik, just modifying CSS through a single stylesheet added by a custom module.

But it's nothing amazing, in my opinion. I think it would've been awesome to have some sort of dropdown menu support in core by this point—but it looks like that will wait until Drupal 8 at least. This is probably the number one most requested feature I get on a lot of the smaller sites I'm asked to build, and having the feature in core would be über-cool.

Exported View: Show OG Content, with filters

For a few of my community-based sites, I wanted to give Organic Groups group members the ability to easily see all the content in their group, regardless of published status, content type, etc., in a list form. Kind of like the universal site Content List, except for each group, and only visible by that group's members.

I've created the view I attached below to do just that—and it has an added bonus of letting users filter their content by published status, content type, or by searching in the title. After importing the view into your own Organic Groups-enabled site, you should be able to modify the view to show links and information custom-tailored to the content on your site.

Example Screenshot:

Group Content List View