Drupal 6.x

Add or remove fields in a Views display and override the Defaults display

A quick tip for Views newbies…

In Views 2.x (Drupal 6.x), if you want to add or remove fields in a Views display, and you want that to override the Defaults display instead of updating it:

  1. In the display, click the Rearrange button next to Fields.
  2. Click Override, then Update.
  3. Add or remove any fields you want.

Drupal Queue API example: enqueue in form submit handler, dequeue when cron runs

Need to store up some items and process them en masse in a cron job? That’s a perfect use case for the Queue API (for Drupal 7+) or the drupal_queue module (the backport for Drupal 6).

Concrete example: One of our consulting clients was using a synchronous webservice for their retail store locator. We needed to create a form where store owners could change whether they’re listed in the store locator. When a store owner submits the form, should she have to wait around while our site sends her change to the store locator webservice? We didn’t think so. So we decided to use Drupal’s Queue API, which lets us save up all the store owners’ changes and send them to the webservice in a batch.

Here’s a simple example of adding items to a queue in a form submit handler and processing them in the next cron run.