If you try to install Drupal while context_menu_block is present it fails with the error:

atal error: Call to undefined function db_query() in /var/www/html/nsmc_test/includes/bootstrap.inc on line 609

This seems to be because context_menu_block_requirements gets called and includes calls to variable_set and drupal_get_path fails to find context so the validation fails too.

Patch supplied skips the requirements if Drupal is installing which is a quick hack to make it possible to install Drupal while the module is present.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

silloyd’s picture

Version: 6.x-3.x-dev » 6.x-3.0-rc1
FileSize
783 bytes

Original patch was against HEAD, this patch is the same but re-rolled for 6.x-3.0-rc1 - helpful here for getting drush make to patch.

Mark Trapp’s picture

Title: Drupal install fails if context_menu_block is present. » Drupal install fails if context_menu_block is present
Priority: Normal » Major
Status: Needs work » Needs review
FileSize
5.16 KB

Yeah, that's not good.

Checking for install_main() doesn't sit right: it's like checking a symptom rather than fixing the cause, and in the case where Context 6.x-2.x is enabled with Context: Menu Block enabled, a WSOD will occur. The version of Context should be checked every time Context: Menu Block is enabled to disable it and prevent the WSOD in the event the wrong version of Context is enabled.

So, I refactored the validation checks from checking during install and runtime to checking during runtime and when the module is enabled. So instead of refusing to enable Context: Menu Block when Context-6.x-3.x isn't enabled, it'll enable the module but disable its functionality and throw an error.

This change should allow the Drupal installation to go forward unhindered and only check when the full system is available.

If you can, check out the patch attached: everything looks good here, but check with your use case. I'll commit it to both branches and roll out new releases in the next day or so either way.

Mark Trapp’s picture

Title: Drupal install fails if context_menu_block is present » Drupal install fails if Context: Menu Block is present
Status: Needs review » Fixed

Committed to the 6.x-3.x and 7.x-3.x branches.

silloyd’s picture

That seems to work great, thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.