Skip to main content

Drupal 6 Block Cache Mode Patch Module

Overview

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 drupal.org. [...]

Source: http://d7cx.com/node/1 (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.

<?php
 
// 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);
  while(
$row = db_fetch_object($result)) {
 
// delete the user account
 
user_delete(array(), $row->uid);
}
?>

Module: Disable collapsible fieldset animations in Drupal 5

Drupal 5 and later versions provide an animation when you expand or collapse a collapsible form fieldset.

While this is a nifty effect, it can be annoying to some users, and it can slow you down when viewing a web page over a Remote Desktop session in Windows (I use Remote Desktop a lot at home, and the expand/collapse animation can take seconds to complete depending on network speed–it all adds up).

Drupal Tips

Our collection of Drupal-specific tips.

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: example.com/admin/settings/performance
  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.

A few bad apples

One or two bad apples may not spoil the whole bunch but they sure do make a foul-tasting pie

I've built, from scratch, a few useful Drupal contributed modules for my own use, and shared them via the Drupal.org contributed modules system. I shared them as my way of supporting the Drupal community (since I benefited from the freely-available Drupal core and other contributed modules).

While the vast majority of users have been polite and reasonable, and a few have offered support, on the whole I find that the majority of users seeking help or reporting bugs do so without offering much in return. Most of the time it seems like a one-sided relationship.

I do appreciate the information most issue reports have to offer but I am unable to respond to all requests in a timely manner. I've been very busy with other priorities over the last year or so, so I've not had much time to dedicate to maintaining the modules I've contributed. The support requests and bug reports have been piling up. As a result I'm seeking new maintainers for all of the modules.

Further, I've decided that I will think twice before sharing future custom Drupal modules via Drupal.org's contributed modules project hosting.

Syndicate content