I've looked/searched around for this issue and I don't seem to find anything. Any ideas?

This is a thread subscription email (from the Subscription module ver. 6.x-1.1) I received once I installed boost. (previous the url links were created correctly and working).

You can see that somehow, the boost "normal" and "cache" folders are being mangled into the urls. "SITE" has replaced my domain, but obviously they would not work, and don't.

Any suggestions as to where to look for the cause of this problem would be appreciated. Thanks.

| Greetings, Bob.
|
| Your subscription on SITE
| notifies you of an updated post:
|
| Title: Bob



| Link: http://normal/SITE.comcache/SITE.com/profile/bob
| Direct unsubscribe link (thread):
| http://normal/SITE.comcache/SITE.com/s/del/node/nid/547/-1/842/876e513cd439f3adf1165506d393c445
| --------------------------------------------------------------------
| This is an automated message. Please do NOT reply to the sender address!
| To manage your subscriptions go to
| http://normal/SITE.comcache/SITE.com/user/842/subscriptions
CommentFileSizeAuthor
#4 boost-711004.patch2.41 KBmikeytown2
#4 boost-711004.patch2.41 KBmikeytown2

Comments

Mercury500’s picture

UPDATE: The URL seems more understandable - IE only the domain is left out this time.

I wonder if it's not a Subscriptions Module issue, but it only seemed to come around when Boost was installed.

latest Subscription email:

| Greetings, Bob.
|
| Your subscription on SITE
| notifies you of an updated post:
|
| Author: Bob
| Title: Cars: Volvo (2009)

(snip snip snip)

| Link: http:///review/bob/2009/review-volvo-2009
| Direct unsubscribe link (thread):
| http:///s/del/node/nid/626/-1/242/c526601a531c9bea5a22a057cbe47b9a
| --------------------------------------------------------------------
| This is an automated message. Please do NOT reply to the sender address!
| To manage your subscriptions go to
| http:///user/842/subscriptions

it seemed to have "fixed" itself, by disabling Boost and re-enabling, and, of course, clearing the cache, but it didn't stay fixed.

Ideas?

What I really don't get is the sheer funkiness of the original url that came out -

http://normal/SITE.comcache/SITE.com/profile/bob

That's not even close to a real url - it's not a Boost's static cache url or a real one either...it's more of a HURL than a URL...

Anyway, thanks for the nice module.

UPDATE 2: THE FIX

This issue appears to be resolved by setting the Base URL in the settings.php file.

Although Boost may not be causing the issue, it may be what brings it to light.

See issue #226335: Incorrect URL in Subscription Email for more info.

Cybergarou’s picture

I'm thinking this is an issue specific to your configuration, either a result of the server software you use or configuration changes you made. I use both the Boost and Subscriptions modules without any trouble and don't have the Base URL set.

Can you describe the configuration changes you made after installing Boost?

Also, verify you have the correct settings in your .htaccess file by going to your site's status report page.

mikeytown2’s picture

Title: Boost Mangles Subscriptions Module URLs » Boost Mangles Subscriptions Module URLs; causes it's $base_url check to fail.
Category: support » bug

FIX: set $base_url in your settings.php file; via #1

Here's the check inside the subscriptions module

function _subscriptions_mail_form_subscriptions_settings_form_alter(&$form, &$form_state) {
  global $user;
  $tr = 't';

  // check the $base_url (#199039, #226335)
  $url = url('', array('absolute' => TRUE));
  if (empty($_POST) && preg_match('!//($|/|localhost/|([0-9]{1,3}\.){3}[0-9]{1,3}/)!', $url)) {
    drupal_set_message(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')), 'error');
  }

...

Which means I shouldn't try to set it magically, or at least not use $base_url, copy it instead.

function boost_cache_directory($host = NULL, $absolute = TRUE, $root_dir = NULL, $normal_dir = NULL) {
  global $base_url;
  $root_dir = is_null($root_dir) ? BOOST_ROOT_CACHE_DIR : $root_dir;
  $normal_dir = is_null($normal_dir) ? BOOST_NORMAL_DIR : $normal_dir;
  if ($base_url == "http://") {
    if (!BOOST_MULTISITE_SINGLE_DB) {
      $base_url = $base_url . str_replace($root_dir . '/', '', variable_get('boost_file_path', boost_cache_directory(NULL, FALSE)));
    }
    elseif (BOOST_NORMAL_DIR != '' && db_result(db_query("SELECT count(DISTINCT base_dir) FROM {boost_cache}")) == 1) {
      $base_dir = db_result(db_query("SELECT DISTINCT base_dir FROM {boost_cache}"));
      $base_url = $base_url . str_replace($root_dir . '/', '', $base_dir);
      $base_url = $base_url . str_replace($normal_dir . '/', '', $base_dir);
    }
  }
  if (@parse_url($base_url) === FALSE) {
    //Error has been caught here
    if (BOOST_VERBOSE >= 1) {
      watchdog('boost', 'base_url is not set in your settings.php file. Please read Important Notes in boosts README.txt file.', array(), WATCHDOG_NOTICE);
    }
    return FALSE;
  }
...
mikeytown2’s picture

Status: Active » Needs review
StatusFileSize
new2.41 KB
new2.41 KB
mikeytown2’s picture

Status: Needs review » Fixed

committed

Status: Fixed » Closed (fixed)

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