When uninstalling a module with Drush, Webform randomly crashes. This is because module_load_include() isn't accessible sometimes.

If you read the documentation, the function must only be used within a other function and not globally.

Patch follows.

Comments

Tessa Bakker created an issue. See original summary.

tessa bakker’s picture

Status: Active » Needs review
StatusFileSize
new656 bytes

The patch will fix this issue, but it would be better to move every hook to webform.module and create a system that autoload every my_module.webform.inc file with webform hooks. Like the module Tokens en Views.

jrockowitz’s picture

I am using these includes to just isolate specific hooks. I am open to create an autoload.

Looks like core is using 'require_once __DIR__ . '/file.field.inc';'

@see http://cgit.drupalcode.org/drupal/tree/core/modules/file/file.module?h=8...

require_once 'includes/webform.libraries.inc'; should be changed require_once __DIR__ . 'includes/webform.libraries.inc';

tessa bakker’s picture

StatusFileSize
new689 bytes

Good catch!

New patch, with __DIR__

jrockowitz’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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