Closed (fixed)
Project:
Lightbox2
Version:
5.x-2.5
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
19 Mar 2008 at 18:28 UTC
Updated:
20 Apr 2008 at 13:54 UTC
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
Comment #1
stella commentedCan 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
Comment #2
psiska commentedHi 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.
Comment #3
stella commentedComment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.