Very minor point but thought id raise it anyway. On the settings page for this module I get the message below. This isnt an error, my site is in the correct place and I dont see this error message anywhere else. Thanks

Your installation returns http://localhost/mysite/ as the base URL of the site. This is probably not what you want, and it can usually be fixed by setting the $base_url variable in your settings.php file.

Comments

karing’s picture

Assigned: Unassigned » karing

Sorry - I can't reproduce that [on any of my subscriptions module installs - including a localhost install] - The base URL is a global Drupal variable. Are you absolutely sure your site is configured properly?

jdln’s picture

I believe so. This isnt an issue for me. I only raised it incase it helped someone else. Im happy for this to be closed. Thanks

karing’s picture

Status: Active » Closed (works as designed)
clcl’s picture

I'm having exact the same thing. Only, I'm working with a bilangual site and it is pointing to 1 language. I was wondering, will this be a problem? http://localhost/mysite/ ?q=nl
Maybe it is better that this point to http://localhost/mysite. But I did look in the default settings.php and there was nothing specified about a base_url. Can someone explain/advise please?

LarsKramer’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Component: Documentation » Code
Status: Closed (works as designed) » Active

I have this problem too, even after setting the $base_url variable in settings.php. In my case it is "http://localhost/drupal-7.22", which is what I want.
I found out where in the code it is generated:
subscriptions_mail.module line 278:

/**
 * Checks the $base_url and provide a warning if needed.
 *
 * @param bool $interactive
 */
function _subscriptions_mail_check_baseurl($interactive) {
  // Check the $base_url (#199039, #226335, #1015320).
  $url = url('', array('absolute' => TRUE));
  if (empty($_POST) && preg_match('!//($|/|localhost/|([0-9]{1,3}\.){3}[0-9]{1,3}/)!', $url)) {
    $msg = t('Your installation returns %url as the base URL of the site. This is probably not what you want, and it can usually be fixed by setting the %variable variable in your %file file.', array('%url' => $url, '%variable' => '$base_url', '%file' => 'settings.php'));
    if ($interactive) {
      drupal_set_message($msg, 'error');
    }
    else {
      $watchdog = 'watchdog';  // keep potx from translating 'cron'
      $watchdog('cron', $msg . ' ' . t('If it happens only when running from cron, then it could be due to a mis-configuration of your cron job.'), NULL, WATCHDOG_ERROR);
    }
  }
}
salvis’s picture

Status: Active » Closed (works as designed)

If "http://localhost/drupal-7.22" is really what you want, then you can safely ignore the message.

Yours is apparently a development installation. Subscriptions cannot tell whether it's running on a development or production site, and we prefer to err on the safe side and bother you a bit on your dev site rather than failing to alert you to the problem on your live site.

What I personally do is to put an alias like d7.local into my hosts file and run my development site under that name.

Sarenc’s picture

Being behind a site-mindered reverse proxy (which requires having a different base_url for cron), we used hook_token_alter to change the [subs:unsubscribe-url] token.