Hi

I just found out that the lightbox module's feature "disabling lightbox for specific URLs" does not work with path aliases / pathauto feature.

/**
 * Return TRUE if current path is disabled for lightbox according to
 * lightbox2_disable_these_urls.
 */
function lightbox2_exclude_these_paths() {
  // Use lightbox if this url is not excluded.
  $disabled_urls = variable_get('lightbox2_disable_these_urls', '');

  if (!empty($disabled_urls)) {
    $urls = explode("\n", $disabled_urls);

    foreach ($urls as $url) {
      $url = rtrim($url);
      if ($url == "<front>") {
        $url = "";
      }
      $url = preg_replace('/%/', '.*?', preg_quote($url, '/'));
      $pattern = '/^'. $url .'$/';
      if (preg_match($pattern, $_REQUEST['q'])) {
        return 1;
      }
    }
  }

  return 0;
}

$_REQUEST['q'] is not node/x but the path stored either by pathauto or yourself, that's why this function does not return 1 as it should.

Comments

stella’s picture

Status: Active » Postponed (maintainer needs more info)

Can you clarify which url you're entering in the disabled urls box for me please? Are you entering in "node/x" or the alias?

Cheers,
Stella

psiska’s picture

Hi Stella

The issue is fixed. I "debuged" your module by dumping the $_REQUEST variable when using pathauto, With pathauto, you have to use the alias of a node, not the actual node id / path, for exclusion.

Regards,
Peter.

stella’s picture

Category: bug » support
Priority: Critical » Normal
Status: Postponed (maintainer needs more info) » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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