The context module's block reaction uses the theme function from the block module to theme blocks, which can work even if the block module is turned off. However, in that case even though block module is disabled, the file block.module is still loaded (automatically by theme.inc) because it contains the theme function.

Now over to webform module - the function webform_node_insert() checks if function_exists('block_flush_caches') and if so, calls that function. That function in turn expects the block table to exist in the database. In the case that block module has never been enabled on a site, and block reaction is used by context, and the webform being inserted is available as a block, if (function_exists('block_flush_caches')) will return true since the file is loaded, even though the block table doesn't exist, and block_flush_caches() will be called, which will result in a fatal error.

CommentFileSizeAuthor
#5 webform-block_error-3005185-5.patch328 bytesgoron

Comments

goron created an issue. See original summary.

goron’s picture

Issue summary: View changes
goron’s picture

Issue summary: View changes
goron’s picture

Issue summary: View changes
goron’s picture

StatusFileSize
new328 bytes

I think this should work to fix it, unless I'm missing some reason that this wasn't used in the first place. Just changes function_exists('block_flush_caches') to module_exists('block')

liam morland’s picture

Status: Active » Needs review
liam morland’s picture

  • Liam Morland committed 19a3e93 on 7.x-4.x authored by goron
    Issue #3005185 by goron: Check that block module is enabled before...
liam morland’s picture

Status: Needs review » Fixed

Thanks!

Status: Fixed » Closed (fixed)

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