I just noticed that when I use the domain navigator as anonymous user the following error is logged
in httpd error_log. I do NOT see these errors when using domain navigator as authenticated user.
PHP Notice: Undefined index: path in ...../domain.module on line 507/508
Apart from errors, dropdown navigation for anonymous users seems ok.
I tried to clear caches on both sides, and cookies, to no effect.
This is with the original 5.x-1.0 Domain Nav

Comments

agentrickard’s picture

Status: Active » Closed (won't fix)

Undefined index: is an E_ALL strict error message.

Drupal 5 does not require E_ALL strict error compliance, and DA does not check for it.

agentrickard’s picture

torgospizza’s picture

I can verify that this is happening on my installation as well. I've looked into it and did some testing and it turns out the 'path' element is not passed in the parse_url array when there is no path to return. (Actually, I found this to be true no matter where I attempted to navigate.) When I did a dump of the variable on a blank screen in PHP 5.1.2, this is what it returned:

Array ( [scheme] => http [host] => example.com )

This appears to be due to the version of PHP. Older versions will pass the 'path' element regardless, whereas since version 4.4.7 it won't return anything. Please see this comment in the parse_url page of php.net: http://us3.php.net/manual/en/function.parse-url.php#77591

Most likely fix would be to check with isset() to see if path is being returned. That's also listed as a best practice in the page you linked to above.

EDIT: Of course, I fixed it somehow on my end, but I wanted to bring this to your attention regardless. Awesome work on this module!

agentrickard’s picture

Yes, but checking with isset() -- E_ALL strict compliance -- is not required in D5.

If you have a patch, I'll commit it, but I'm not spending time on this.

agentrickard’s picture

Component: - Domain Nav » Code
Category: support » bug
Status: Closed (won't fix) » Needs review

The issue is actually not in Domain Nav. It's in the main module. Domain Nav just causes it to appear frequently.

function domain_get_path($domain) {
  global $base_url;
  $_url = parse_url($base_url);
  // We need a trailing slash at the end of the path
  if (!isset($_url['path']) || substr($_url['path'], -1) != '/') {
    $_url['path'] .= '/';
  }
  $path = $domain['scheme'] .'://'. $domain['subdomain'] . $_url['path'];
  return $path;
}

Is this the fix?

agentrickard’s picture

Status: Needs review » Fixed

Fixed and committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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