Hi there!
I have been using domain access for some time on a project of mine, and since the very beginning I am having this notice:
"Undefined index: path in domain_url_outbound_alter() (line 127 of ......./sites/all/modules/contrib/domain/settings_custom_url.inc)."
It has never caused any issue so I never really took time to understand it but I am currently trying to clean some stuff so I would like it to work properly. I have seen some people having the same issue but no solution :(
I unfortunately don't know how to reproduce it but I will try to give some context:
- When dpm() the $path_lookup, the current subdomain has very minimal information, (domain_id, subdomain, site_grant, sitename): missing the path.
- Only the main domain has all the domain info, including the path.
When backtracking notice with devel, I don't see any contrib module or custom code that could alter this.
I was able to remove the notice by loading the domain before altering the path:
if ($path_lookup[$name] != $_domain) {
$options['absolute'] = TRUE;
// In this case, the $base_url cannot have a trailing slash
$domain_load = domain_load($path_lookup[$name]['domain_id']);
$options['base_url'] = rtrim($domain_load['path'], '/');
$target_domain_id = $path_lookup[$name]['domain_id'];
// TODO: merge this code with the above for cleanup.
}
I know it is not the solution, but I am hoping it will get to the solution.
I will continue to investigate and update here if I find anything.
Thank you for your help,
Edouard
Comments
Comment #2
heyddi CreditAttribution: heyddi commentedAlright, I have been able to understand my issue, in case that helps someone one day:
I was poorly implementing the hook_domain_source_path_alter. When returning the source, I am now returning the fully loaded domain and it works fine like this.