After disabling the mapbuilder module, the site hangs. This is because the module defines blocks whom visibility is determined by a function defined in the same module. If the module is disabled, that function cannot be found and the site hangs. It can be used again e.g. by deleting that modules entries in the blocks table.

Comments

harry slaughter’s picture

Project: Drupal core » Mapbuilder
Version: 5.1 » 5.x-1.x-dev
Component: base system » Code
jpulles’s picture

Project: Mapbuilder » Drupal core
Version: 5.x-1.x-dev » 5.1
Component: Code » base system

I think that drupal should prevent in this case that a module can cause a problem. Note that if a module is disabled, and you look at the admin/build/block page, the list of blocks is rebuild and those entries for a disabled module are removed. Probably, when a module is disabled, it's entries in the blocks list should be removed by the drupal core to prevent that the list of blocks contain calls to php functions which cannot be found anymore.

At present I have solved this by putting the following code in my block:

<php return function_exists("mapbuilder_block_visibility") ? mapbuilder_block_visibility("overview") : false; ?>

It doesn't make sense, to check if a functions exists in the same module that defines it.

marcingy’s picture

Maybe the solution is to amend the sql select statement in block_list so as it only returns blocks for modules which themselves are enabled.

This will require an additional join to the system table.

dpearcefl’s picture

Status: Active » Closed (won't fix)

Considering the age of this issue with no responses and that D5 is unsupported, I am closing this issue.