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 |
Jump to:
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
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
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
Corrected the title
#4
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
Can anyone here who reported the error tryout the latest dev to see if that fixes this error?
#6
Fairly sure #174380: Remove symlink creation. Let each path have own file fixed this reported error. Reopen if I'm mistaken.
#7
Automatically closed -- issue fixed for 2 weeks with no activity.