Drupal 7.50 generates a warning if a function like module_load_include references a module that does not exist(see https://www.drupal.org/node/2487215 and https://www.drupal.org/node/2581445).

There is a technique that has been used of doing a module_load_include on the (non-existent) content module in order to load root Drupal include files (see #2762675: The following module is missing from the file system: content.. Because of the above change, this is no longer advisable. Such includes should instead be done as:

require_once DRUPAL_ROOT . '/(pathname to include file)';

modules/crm_core_data_import/plugins/conversion/CRMCoreConversionHandler.inc

The code in function countryCode

module_load_include('inc', 'content', 'includes/locale');

should be

require_once DRUPAL_ROOT . '/includes/locale.inc';

Patch to follow.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Ben Coleman created an issue. See original summary.

Ben Coleman’s picture

The attached patch fixes the above problem.

Ben Coleman’s picture

Status: Active » Needs review
bobburns’s picture

If you have Ubercart installed check => https://www.drupal.org/files/issues/2763555-4.patch

Ben Coleman’s picture

Yeah, I caught that already, and it's installed. I ended up searching all of the contrib modules on one of my sites that was getting this, and CRM Core was one that came up. It's not likely to be the cause of the warning popping up on my site (given that the code is in a plugin), but it will pop up if someone uses that plugin, so it might as well be fixed.

  • RoSk0 committed 953b768 on 7.x-1.x authored by Ben Coleman
    Issue #2765917 by Ben Coleman: Fix content module missing warning in...
RoSk0’s picture

Status: Needs review » Fixed

Thanks for the patch!
Replaced "require" with "include" as core suggesting.

Status: Fixed » Closed (fixed)

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