During a 'typical install' I selected the modules I wanted and hit submit. I was then told that I'd not selcted some dependencies... So I clicked proceed to have them enabled for me... I then got a White-Screen-O-Death...

I checked my error logs and found this:

2008-04-25 12:13:02: (mod_fastcgi.c.2592) FastCGI-stderr: PHP Fatal error:  Call to undefined function store_mail_types() in /var/www/html/www.4hd.net/drupal/sites/www.4hd.net/modules/ecommerce/ec_mail/ec_mail.module on line 458

So I jumped onto that line and its referring to this section of code...

  foreach ($modules as $module) {
    $function = $module .'_mail_types';
    foreach (array_keys($function()) as $type) {
      if (in_array($type, $types) or !count($types)) {
        $imps[$type] = $module;
      }
    }
  }

So this function looks for hooks and then tries to run them, simply assuming they exist... So I changed it to:

  foreach ($modules as $module) {
    $function = $module .'_mail_types';
    if (function_exists($function)) {
      foreach (array_keys($function()) as $type) {
        if (in_array($type, $types) or !count($types)) {
          $imps[$type] = $module;
        }
      }
    }
  }

The issue has now disappeared. So the 'patch' in this case is simple to wrap the foreach in a condition that the function exists... I kinda figured there was little point creating a patch file for this as it'd be just as easy to apply yourself :-)

Nick

Comments

nicholasthompson’s picture

Status: Closed (duplicate) » Needs review

Just noticed this as a duplicate (didn't see the issue when I first searched...)

Original issue: #237494: [ec5.x-4.x-dev] Call to undefined function store_mail_types() in ec_mail.module on line 458

nicholasthompson’s picture

Status: Needs review » Closed (duplicate)

Sorry - forgot to reset the status

gordon’s picture

Status: Needs review » Fixed

The store_mail_types() had been moved from the store.module to store.manage.inc

I have included this in the installation so it doesn't fail.

See http://drupal.org/cvs?commit=112872

Anonymous’s picture

Status: Fixed » Closed (fixed)

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