After successful checkout, I get 2 of the exact same warning messages:
warning: Invalid argument supplied for foreach() in /home/ghcart/public_html/sites/all/modules/uc_domain/uc_domain.module on line 257.

Any ideas?

Comments

jimboh’s picture

It doesent look like this module is being supported so...
line 257 of uc_domain.module checks for $domain['alias'] when it should check for $domain['aliases'] and also it should only do the test for aliases if the domain _alias module is enabled.

I am not a skilled php coder so check my work but I changed lines 254-270 from:

  $domain = domain_lookup($vars['domain_id']);

  $is_alias = FALSE;
  foreach ($domain['aliases'] as $alias) {
    // Check if current base url is an alias, f.ex localhost
    if (strpos($original_base_url, $alias['pattern'])) {
      $is_alias = TRUE;
    }
  }

  if (!$is_alias) {
    // Temporarily replace global $base_url so url() returns correct results for the domain.
    $base_url = $domain['path'];
    if (substr($base_url, -1) == '/') {
      $base_url = substr($base_url, 0, -1);
    }
  }

To:

  if (module_exists('domain_alias')) {
    $domain = domain_lookup($vars['domain_id']);
  
    $is_alias = FALSE;
    foreach ($domain['aliases'] as $alias) {
      // Check if current base url is an alias, f.ex localhost
      if (strpos($original_base_url, $alias['pattern'])) {
        $is_alias = TRUE;
      }
    }
  
    if (!$is_alias) {
      // Temporarily replace global $base_url so url() returns correct results for the domain.
      $base_url = $domain['path'];
      if (substr($base_url, -1) == '/') {
        $base_url = substr($base_url, 0, -1);
      }
    }
  }
mandreato’s picture

I had the same issue and #1 fixed it.
Hope it will be commited.

aoturoa’s picture

Issue summary: View changes
StatusFileSize
new1.34 KB

Added the above as a patch.