boost_cache_set not getting the correct url alias

andreiashu - December 3, 2008 - 21:10
Project:Boost
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hey, i just started using boost (the 6.x.1.0-alpha1 version) and i think that i'm doing something wrong here. I have pathauto installed, all the urls are aliased, but in boost_init for any url like "http://mywebsrv/alias_name", $_GET['q'] returns something like "node/nid".
I'm using apache2, php 5. I verified in the {system} table: boost has the lowest weight value (-90) so it gets called first.
Any ideas ?

Thanks,
andreiashu

#1

andreiashu - December 3, 2008 - 22:56
Title:$_GET['q'] is node/#nid even with pathauto» boost_cache_set not getting the url alias
Status:active» postponed (maintainer needs more info)

Oki, i just realized how stupid i was.
The problem is that in "boost_cache_set" function both 'drupal_get_path_alias' and 'drupal_get_normal_path' return the same path - 'node/nid' when in fact drupal_get_path_alias should return the alias of the node...
I'll digg into this more and i'll post the results here.

#2

andreiashu - December 3, 2008 - 23:20

Oki, i think i found what the problem was: in a multilanguage site you must pass the current lang path to 'drupal_get_path_alias' and 'drupal_get_normal_path' functions.
So instead of:

$alias = drupal_get_path_alias($path);
$path = drupal_get_normal_path($path); // normalize path

the code should look like this:
$lang_prefix = language_initialize()->prefix ? language_initialize()->prefix : '';
$alias = drupal_get_path_alias($path, $lang_prefix);
$path = drupal_get_normal_path($path, $lang_prefix); // normalize path

At least for me it works. Please tell me if this makes any sense to you.
Thanks

#3

andreiashu - December 3, 2008 - 23:21
Title:boost_cache_set not getting the url alias» boost_cache_set not getting the correct url alias

Corrected the title

#4

mustafau - December 13, 2008 - 21:53
Version:6.x-1.0-alpha1» 6.x-1.x-dev

I believe this is duplicate of another issue; #326241: db_set_active().
Suggested fix in this issue does not work for me. I am getting a WSOD after passing current lang to 'drupal_get_path_alias' and 'drupal_get_normal_path' functions.

#5

mikeytown2 - April 22, 2009 - 09:23
Status:postponed (maintainer needs more info)» needs review

Can anyone here who reported the error tryout the latest dev to see if that fixes this error?

#6

mikeytown2 - April 29, 2009 - 06:01
Status:needs review» fixed

Fairly sure #174380: Remove symlink creation. Let each path have own file fixed this reported error. Reopen if I'm mistaken.

#7

System Message - May 13, 2009 - 06:10
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.