Skip to main content

Drupal 6.x

Drupal 6 Block Cache Mode Patch Module


Drupal 6 has a long-standing bug in the block module (as of 5/10/2011). This bug affects block caching mechanisms. The bug manifests itself if you have block caching enabled.

Once a module's blocks have been registered with the system (in the {blocks} table), the block's caching mode settings are never updated in the {blocks} table, regardless of subsequent cache flushes or other system updates. This is only a problem for modules that change the 'cache' info returned from hook_block op='list' calls.

Uninstalling and re-installing the module won't fix the problem due to another Drupal 6 bug.

More info

This problem impacts any module that changes the caching mode returned in hook_block('info') operation. In particular, the views module allows you to edit a block view's caching mode after creation, but, due to this bug, the changes will never take effect, leading to much head-scratching.

More info

The fix

There are a few core patches available (see Issue 235673, above), but they may not apply cleanly to your Drupal 6 installation; I don't patch core unless there's a critical need. In this case, the patches failed to apply on the sites that needed the fix. So I created a simple custom module that implements the guts of the most recent patch.

Note: You can download the module in the Attachments section, below. Leave a comment if you find this module useful, or, if you have questions about it.

What SINGLE new feature is most important for the next release of the Drupal AdSense (Content) Injector module?

Essential Drupal Modules for Drupal 7

Drupal 7 has been released. As expected, it appears to be a significant improvement over Drupal 6 and earlier versions. Congratulations to the core team for this major milestone!

But what about essential contributed modules? The #D7CX (Drupal 7 Contrib Experience) effort was intended to ensure that Drupal 7 did not suffer the same fate as the Drupal 6 release -- many modules were not available for Drupal 6 well after its release (the problem continues to this day).

In order to make the biggest possible impact, we need as many modules as possible to have full Drupal 7 releases on the day when core Drupal 7 is released. Our failure to accomplish this for Drupal 6 was devastating. So, let's turn our attention toward D7CX - Drupal 7 Contrib Experience.

We are collecting pledges from maintainers to support the D7CX effort. A pledge consists of writing a statement like below at the top of your project page on [...]

Source: (now defunct)

My experience shows that availability of stable contributed modules is crucial to adoption: I delayed migration from Drupal 5 to Drupal 6 on my existing web sites for well over a year, and when rolling out a new web site that would have been perfectly suited to Drupal, I chose to roll out with Drupal 5 due to the availability of fully released and tested contributed modules.

As a former Drupal contrib module developer, I understand the difficulties related to upgrading modules for each major version's new release. I'm just now getting back into Drupal module development, and with the Drupal 7 release now a reality, I wanted to know how successful the #D7CX pledge effor twas. So I started digging around, looking for contributed modules with a full

As of today, 1/9/2011, here are some of my favorite Drupal contributed modules that do not have a full Drupal 7 release available on the project homepage. (Most have alpha, beta, or -dev versions available, and they may be perfectly usable on a production site, though I'd suggest a thorough test first.)

  • Administration Menu
  • Adsense
  • Adsense Injector
  • Amazon
  • Bad Behavior
  • Devel
  • Google Analytics
  • Image API
  • LoginToboggan
  • Mollom
  • Panels
  • PathAuto
  • Token
  • Views
  • XML Sitemaps

So, unless I misunderstand what "a full Drupal 7 release" means, it looks like we have a ways to go. I will see if there is any way I can assist in the effort...

How about you? What modules do you rely on, and are they available for Drupal 7 as a full release? If not, what can you do to help make the Drupal 7 version available soon?

Drupal SQL Query Snippet: Move taxonomy terms from one or more vocabularies into another vocabulary

How do I move Drupal taxonomy terms from one vocabulary to another?

While you can use the excellent Taxonomy Manager module to move taxonomy terms between vocabularies, it's not always worth the trouble to install yet another module. For example, if you are doing this as a one-time merge of several vocabularies into a new vocabulary.

Here's the recipe:

  1. Identify the vocabulary ids (vid) for the source vocabularies. In our example, the source vocabulary ids are 6, 7, 8, and 9.

Drupal for E-Commerce

Using Drupal for E-Commerce

So, you're using Drupal to run your site. You'd like to sell products to site visitors. What are your options? This page provides an overview of some of the available solutions.

Drupal and Paypal

You can 'roll-your-own' integration, or use the LM_Paypal module.

The LM_Paypal module is not intended to be a full e-commerce solution, but it does provide some types of built-in PayPal payment notifications, and when payment is completed, LM_Paypal module receives and records the notification. It allows for very simple automated donations, subscriptions, and paid advertisements. You should evaluate this module to see if it meets your needs. There are some significant limitations, so be sure to read the issues queue to ensure that the module does what you want it to do.

Drupal and E-Junkie

E-Junkie is a lightweight online shopping cart and fulfillment system. This blurb, taken from their home page, describes the system.

E-junkie provides shopping cart and buy now buttons to let you sell downloads and tangible goods on your website, eBay, MySpace, Google Base, CraigsList and other websites using PayPal Standard, PayPal Pro, Google Checkout, Authorize.Net, TrialPay, ClickBank and 2CheckOut.

For merchants selling downloads, we automate and secure the digital delivery of files and codes. If you are selling tangible goods, we automate the shipping calculation and inventory management. Our shopping cart has a built in sales tax, VAT, packaging and shipping cost calculator.

E-Junkie Drupal Integration

That sounds great, but how do I integrate E-Junkie with Drupal? At present, I have not found any third-party Drupal modules offering E-Junkie and Drupal integration.

There are integration examples and how-to posts floating around on the web, however:

Drupal and Ubercart

Ubercart is an extensible e-commerce system that provides native product and shopping cart management within Drupal. Configuration can be somewhat complicated, but it does offer a complete solution with numerous add-in modules. You should plan for significant configuration, customization, and theming effort if the standard appearance and features are not close to what you want.

Extension modules of varying quality are available, and these may help you implement the features you want–be sure to set up a test site and verify all functionality before "going live".

Drupal PHP Snippet: Delete users with no nodes

Here's a handy PHP snippet to purge user accounts for all users who haven't created any nodes on your site. It's useful when you have a lot of users who have signed but haven't created any nodes.

// Get a list of all users in the site who have not created any nodes, AND uid > 1
$sql = "SELECT u.uid FROM {users} u WHERE u.uid NOT IN (SELECT DISTINCT n.uid FROM {node} n) AND u.uid > 1 ORDER BY uid";
$result = db_query($sql);
$row = db_fetch_object($result)) {
// delete the user account
user_delete(array(), $row->uid);

Drupal 6.x Sub-Theme Development Troubleshooting Checklist

The Drupal Sub-Theme system is a welcome addition to the Drupal system. There are a few gotchas that can trip up the unwary. Here's a quick troubleshooting list to check when you are creating a sub-theme based on an existing Drupal theme.

  1. Disable Drupal's CSS and JavaScript caching in your site's admin settings/performance page:
  2. Be sure to define at least one style sheet in your .info file. Base theme style sheets are not inherited unless you define at least one style sheet for your sub-theme
  3. Avoid Frustration: Some changes won't take effect right away. Rebuild the Drupal theme cache by visiting your site's admin/build/themes page (hit the browser reload button just to be certain!)
  4. White Screen Of Death?: If you override one of the base theme's template files, then later delete it, you may fall victim to the dreaded WSOD, and will be unable to access the site. Solution: the theme cache may need to be cleared.
    • If you can't access your site due to a WSOD, use a SQL query to delete the theme cache entry from the {cache} table: delete from cache where cid like 'theme_registry%'; then reload your site's page. For more information, see Clearing the Theme Cache.

Useful Drupal Administrative SQL Queries

Quite often, it is necessary to perform batch operations on a drupal-based site - operations on multiple users, or multiple nodes, for example, and the administrative interfaces don't support the desired operation.

I've put together a list of my favorite queries on this page. I'll update these as time permits.

Syndicate content