Must have and popular Drupal modules

I've seen a lot of top 10 (20) listings of favourite Drupal modules appear on the net lately. So I couldn't be left behind.

Below you'll find a listing of my "must have" modules that I install on pretty much every website (if needed of course). Even more below you'll find a few links to popular modules: modules that are popular in the community.

PHP filter and search index woes

PHP filter is a great filter. It gives you a lot of flexibility. But it has a lot of disadvantages too. One of them is that it makes your code harder to debug.

One of those hard debug sessions occurred lately when the following happened. Cron always stopped running when it was going to index this one node. It also redirected to some page. Weird.

What was happening? The node was a page. The body was having the PHP filter on and the following code was in that body:

<?php drupal_goto("node/add/story"); ?>

What does this have to do with search indexing you ask? Well, when the search indexer is going to index a node, it first runs all filters on your body, and it's the result of that that is getting indexed. So if you're writing PHP code, that code is run when the indexer comes along. Even "non-text generating" code, like the redirect in this case.

Clear cache before running hook_boot for the first time

I've bumped my head over this one a few times now and I always tend to forget. If you're implementing hook_boot, the module cache (system table) needs to be rebuilt. You can do this by going to admin/build/module.

Why is this? hook_boot is called during the bootstrap like this:


/**
 * Call all init or exit hooks without including all modules.
 *
 * @param $hook
 *   The name of the bootstrap hook we wish to invoke.
 */

function bootstrap_invoke_all($hook) {
  foreach (module_list(TRUE, TRUE) as $module) {
    drupal_load('module', $module);
    module_invoke($module, $hook);
  }
}

As you can see, module_list is called here with the second parameter set to TRUE. Looking at what this parameter means, gives us $bootstrap. Let's look at the (partial) implementation of the module_list function to see what it's used for:

function module_list($refresh = FALSE, $bootstrap = TRUE, $sort = FALSE, $fixed_list = NULL) {
//...
      if ($bootstrap) {
        $result = db_query("SELECT name, filename, throttle FROM {system} WHERE type = 'module' AND status = 1 AND bootstrap = 1 ORDER BY weight ASC, filename ASC");
      }
//...      
}

We're filtering on bootstrap = 1 when selecting from the system table.

As you know or not know, this table only gets (re)built when the available modules are scanned. This happens when module_rebuild_cache is run. This is what gets done if you go to your modules page.

Relaunch of my portfolio site

I just relaunched my portfolio site.

Screenshot davyvandenbremt.be (v4)Screenshot davyvandenbremt.be (v4)

http://www.davyvandenbremt.be

Disabling password check in Drupal 6

I've had some clients not wanting the uber cool password strength checking in Drupal 6. Well, here's a very short tip how to disable this.

Just add the following in some javascript (your theme, your module, ...)

<script language="javascript">
// disabling password security check
Drupal.behaviors.password = function(context) {
  return;
}
</script>

Hooray for behaviors!

Password checking in Drupal 6Password checking in Drupal 6

Syndicate content