I am getting an error for a Commerce module I know was never added or installed, and it is appearing in sites using this theme. I wondered if the problem could be a missing file trying to be loaded by the theme (not an uninstalled module).

User warning: The following module is missing from the file system: <strong>commerce_cart.</strong> In order to fix this, put the module back in its original location. For more information, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1128 of .../includes/bootstrap.inc).

I have this for about 10 other modules, all commerce_ ... modules.

Comments

april26 created an issue. See original summary.

april26’s picture

Title: Conflict with AT-commerce and Drupal v7.50 » Conflict with AT-commerce and Drupal v7.50?
Jeff Burnz’s picture

Category: Bug report » Support request
Priority: Major » Normal
Status: Active » Closed (works as designed)

Not a theme issue. See: https://www.drupal.org/node/2487215

april26’s picture

The website with the errors is very simple, and there have never been ANY Commerce modules placed in the modules folder, and definitely nothing installed and uninstalled.

I have the identical error on 2 websites, and both are "vanilla" D7 websites with only a handful of 3rd party utilities modules (ckeditor, metatags, etc.).

I don't understand much about the detail of this error, but I wondered if the following theme file is the problem:

In at-commerce/template.php on line 228 it says

$cart_theme = drupal_get_path('module', 'commerce_cart') . '/theme/commerce_cart.theme.css';

on line 234 it says

$checkout_base = drupal_get_path('module', 'commerce_checkout') . '/theme/commerce_checkout.base.css';

ON line 252 it says

$customer_admin = drupal_get_path('module', 'commerce_customer') . '/theme/commerce_customer.admin.css';

etc.

These are amongst the missing modules mentioned in the errors. Are you completely sure that these are not causing the errors?

april26’s picture

On the template.php file I did the following, and so far it looks like the errors are gone.

if (module_exists('commerce_cart')) {
  $cart_theme = drupal_get_path('module', 'commerce_cart') . '/theme/commerce_cart.theme.css';
  if (isset($css[$cart_theme])) {
    $css[$cart_theme]['data'] = $path . '/css/commerce/commerce_cart.theme.css';
    $css[$cart_theme]['group'] = 1;
  }
}

i.e. I added the first line and closing tag for each commerce module mentioned with "drupal_get_path".

Jeff Burnz’s picture

Category: Support request » Bug report
Status: Closed (works as designed) » Active

yikes, looks like you're right: https://www.drupal.org/node/2581445

Gawd, look at the hack we're being asked to use: $module_exists_in_filesystem = (bool) drupal_get_filename('module', 'module_name', NULL, FALSE);

Jeff Burnz’s picture

@ #5 hmmm, are you sure they're gone, module_exists() calls module_list which calls... drupal_get_filename($type, $name, $filename = NULL, $trigger_error = TRUE), so in reality calling module_exists() should trigger the error anyway, which is why I believe the recommended way is #6 to get a TRUE/FALSE without the trigger waring (set to FALSE).

Am I wrong here?

Jeff Burnz’s picture

E.g. (untested):

$module_exists_in_filesystem = (bool) drupal_get_filename('module', 'commerce_cart', NULL, FALSE);
if ($module_exists_in_filesystem == TRUE) {
  $cart_theme = drupal_get_path('module', 'commerce_cart') . '/theme/commerce_cart.theme.css';
  if (isset($css[$cart_theme])) {
    $css[$cart_theme]['data'] = $path . '/css/commerce/commerce_cart.theme.css';
    $css[$cart_theme]['group'] = 1;
  }
}
Jeff Burnz’s picture

Priority: Normal » Major

I asked a senior Drupal developer about module_exists(), he said he thinks it should be OK, however it's quite hard to see how that can be, module_list() does some caching but I can't see how it returns the module list wihtout hitting drupal_get_filename(), so...

Basically you could update to the DEV version (it's had module_exists() checks for quit some time), or wait for some testing to be done, then I will release a new version.

april26’s picture

They appear to be gone, even with "all error messages" on and caches cleared. My programming skills aren't great so it was more luck than good judgement that I found a solution to stop the error messages. And I may have caused other problems.

AT Commerce is the best D7 theme and I use it on dozens of websites. I often adapt the page and node templates, add bootstrap etc. making a version update nerve-wracking, so I am going to wait on this v7.50 update.

Jeff Burnz’s picture

cconnolly’s picture

Thanks to you, April26, for raising this issue and to you, Jeff Burnz, for developing & releasing a revised & fixed version of the theme so quickly...

Before I found this thread this morning, I'd been scratching my head most of yesterday with exactly the same problem, having just returned from holiday and decided to update to the v7.50 core before the "high risk" security updates were released, in case any were applicable to me.

I knew I'd never installed the modules referred to in the warning, and quickly realised it could only realistically be to do with the AT Commerce theme, but hadn't got any further. so you've both saved me a load of time today! :-)

Best

Colin C.

Status: Fixed » Closed (fixed)

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