Error on language prefix in url
maximust - March 3, 2008 - 16:03
| Project: | Click HeatMap |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | boombatower |
| Status: | active |
Jump to:
Description
All links in scrips doesn't support language prefix in url (example: http://localhost/en/modules/click_heatmap/clickheat/click.php?s=...)

#1
I fix it by replacing function 'click_heatmap_footer' with this one:
/*** Implementation of hook_footer().
*/
function click_heatmap_footer() {
global $base_url;
if (click_heatmap_display()) {
drupal_add_js(
"clickHeatSite = '". variable_get('site_name', 'Drupal Click Heatmap') ."';
clickHeatGroup = '". click_heatmap_get_url() ."';
clickHeatServer = '".$base_url.'/'.drupal_get_path('module', 'click_heatmap') ."/clickheat/click.php';
initClickHeat();",
'inline', 'footer');
return '<script type="text/javascript" src="'. base_path() . drupal_get_path('module', 'click_heatmap') .'/clickheat/js/clickheat.js"></script>'."\n";
}
}
#2
I am at Drupalcon and do not have access to a developement computer. I will work on this once I return home this weekend.
#3
I made the necessary changes for the 5.x and 6.x branches.
Use the new release 2.3.
#4
#5
Automatically closed -- issue fixed for two weeks with no activity.
#6
I have the same problem with D6.
clickHeatServer = '". click_heatmap_remove_language_prefix(url(drupal_get_path('module', 'click_heatmap') ."/clickheat/click.php", array('absolute' => TRUE))) ."';return
clickHeatServer = 'http://www.webstrat.sites/all/modules/click_heatmap/clickheat/click.php';instead of
clickHeatServer = 'http://www.webstrat.fr/sites/all/modules/click_heatmap/clickheat/click.php';#7
#8
Not sure what is going on there. I enabled french and paths and such and went to http://d6x.loc/fr and if I comment out:
<?phpreturn str_replace('/' . $language->prefix . '/', '/', $url);
?>
then I see:
var clickHeatServer = 'http://d6x.loc/fr/sites/default/modules/click_heatmap/clickheat/click.php';and if I uncommented I get:
var clickHeatServer = 'http://d6x.loc/sites/default/modules/click_heatmap/clickheat/click.php';I have not changed anything related to this bit, but please try running dev. It would appear you do not have a language prefix set thus it is only removing '/'.
I will change:
<?phpif ($language->prefix != '') {
?>
to
<?phpif ($language->prefix) {
?>
#9
Wonderfull Jimmy,
This problem is solved by the dev release.
Thanks
Sylvain
#10
Ok, great.
#11
Automatically closed -- issue fixed for 2 weeks with no activity.
#12
There is still a problem with the language prefix.
If under "Site configuration » Languages" the option "Path prefix with language fallback." is selected, the prefix (e.g. "/de") is added to the path.
The Option "Reports » Click heatmap" then is linked to "/de/admin/reports/click_heatmap". Clicking the link does not redirect to the Click heatmap report page -- instead a "Page not found" error is displayed.
I have encounterd this problem with the versions 6.x-2.6 and 6.x-2.x-dev (2009-Oct-21) of Click HeatMap.