Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#2 | context_menu_block-1065802-2-fix_install_error.patch | 5.16 KB | Mark Trapp |
#1 | context_menu_block-1065802.1.patch | 783 bytes | silloyd |
context_menu_block.patch | 701 bytes | silloyd | |
Comments
Comment #1
silloyd CreditAttribution: silloyd commentedOriginal 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.
Comment #2
Mark TrappYeah, 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.
Comment #3
Mark TrappCommitted to the 6.x-3.x and 7.x-3.x branches.
Comment #4
silloyd CreditAttribution: silloyd commentedThat seems to work great, thanks.