After updating this weekend to Domain Access 6.x-2.0, we found our sites running Domain Access were broken. We were getting fatal errors about check_url() not being defined in domain.module at line 1042.

We removed all the Domain Access related modules, reinstalled them, and ran update.php. That seemed to fix the problem.

I'm posting this here in case any one else is experiencing the same problem.

Comments

agentrickard’s picture

Status: Active » Closed (duplicate)

Already committed a patch. Please search the queue under 'fixed' and Drupal 5.

sahlborn’s picture

I encountered the same error when updating from 2.0rc9 to 2.0. But I wasn't able to solve it, except when removing the function check_url(...) at line 1042 in domain.module, which I think is not a good solution though...

hoza’s picture

I just upgraded Domain Access from rc9 to 2.0 and had this same error for line 1042 of domain.module. It does appear to affect Drupal 6, unless I'm not updating something else correctly. (Ref: Use of check_url() breaks caching)

I've done this edit at line 1042 (copied line and removed the check_url() function) and everything works fine now for me, although I feel it's a hack too, sahlborn:

//$path = check_url($domain['scheme'] .'://'. $domain['subdomain'] . $_url['path']);
$path = $domain['scheme'] .'://'. $domain['subdomain'] . $_url['path']; 

Is there something else I should be doing to fix this better?

Thanks!
Paul

giorgosk’s picture

Version: 6.x-2.0 » 6.x-2.1
Status: Closed (duplicate) » Active

updated from rc9 to 2.1 and encountered the same problem
solution in #3 works for me

is there any reason for the usage check_url ?

agentrickard’s picture

check_url() is a security function to ensure that only valid urls are used.

This does not occur in Drupal 6.x under normal conditions (e.g. 'normal' mode page caching or disabled caching).

What else are you doing that might cause this? Alternative caching? Other modules that use custom_url_rewrite_*?

Does this occur on _all_ pages for _all_ users, or on specific pages for specific users?

giorgosk’s picture

not any module that I know is using custom_url_rewrite_*

I will need to reenable the module and try to debug the error

agentrickard’s picture

This bit us in D5 because hook_init() isn't loaded on cached pages, but that is not the case in D6.

common.inc isn't loaded until BOOTSTRAP_FULL, so anything that prints output before then might be the cause.

agentrickard’s picture

Status: Active » Postponed (maintainer needs more info)
giorgosk’s picture

Version: 6.x-2.1 » 6.x-2.2

on update to 2.2

Fatal error: Call to undefined function check_url() in /home2/hotelsat/public_html/sites/all/modules/domain/domain.module on line 1045

#3 solved the problem again

how to I start debugging this ?

giorgosk’s picture

It might have to do with the in my settings.php

function custom_url_rewrite_outbound(&$path, &$options, $original_path) {
  // Call fb module first
  if (function_exists('fb_settings_url_rewrite_outbound')) {
    fb_settings_url_rewrite_outbound($path, $options, $original_path);
  }
  if (function_exists('domain_url_rewrite_outbound')) {
    domain_url_rewrite_outbound($path, $options, $original_path);
  }
}

I erased (after update with previous fix) and site works OK

I think domain now uses http://drupal.org/project/url_alter and had not realized
while I had this enabled on my site

agentrickard’s picture

Yes. Does switching to url_alter module and removing the code from settings.php solve the problem?

giorgosk’s picture

Status: Postponed (maintainer needs more info) » Fixed

well I can't tell if the update would be OK because I already had run the update with the fix above

but switching to the url_alter and dropping the code from within the settings.php seems to produce no errors/warnings

I assume that this was the problem then

agentrickard’s picture

I think so. It was a condition I was never able to replicate, which is why the code never changed.

giorgosk’s picture

Version: 6.x-2.2 » 6.x-2.3
Category: bug » support
Status: Fixed » Active

still get this error on updating just the domain module to 2.3

 Fatal error: Call to undefined function check_url() in \sites\all\modules\domain\domain.module on line 1069

don't know what to look for ?

agentrickard’s picture

This is not a DA problem, AFAIK. It's a conflict with some other module or custom code. Did you switch to using URL Alter? Do you still have custom code in settings.php?

Did you get this error when running update.php?!?

giorgosk’s picture

since last update

URL alter has been part of the installation
and the custom code from settings.php has been erased

why is it not seeing the check_url function ?
is that function part of URL_alter ?

immediatelly after putting the 2.3 files in place (before even running update.php)
trying to access ANY page of the site gives the above error

agentrickard’s picture

check_url is in common.inc (see #7).

If you have alternative or advanced caching turned on, this would make sense. Neither are supported.

giorgosk’s picture

on admin/settings/performance

Normal caching
page compression
js compression
css compression
are enabled

no other caching module used

are those compatible with domain ?

agentrickard’s picture

Yes, though CSS and JS compression may not work if you use Domain Theme.

I simply cannot replicate this error. Never could on D6. So that suggests custom code or other modules.

agentrickard’s picture

You might look through your modules and see if any implement hook_boot(), which could be an issue. But if that were the case, the Performance page would give you a warning.

Ibn al-Hazardous’s picture

The hook_boot tip is spot on. I got this error trying to upgrade from 2.0-rc8 to 2.5 - and I have two modules that implement hook_boot: devel and shared sign-on (I know it's insecure, I'll switch away real soon now) - and it seems it stumbled on shared sign-on (works fine with just devel enabled).

Since the problem module for me is emphatically unsupported, I'd say this isn't a big issue. GiorgosK, are you using the same module? To check for other problematic modules, you could run the following command (in your sites/all/modules folder):
user@server# grep _boot * -R | grep function

It'll return all implementations of hook_boot for you.

agentrickard’s picture

Devel doesn't throw this error for me, so I suspect SSO.

agentrickard’s picture

Status: Active » Closed (duplicate)

Fixed this recently.