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
Description

All links in scrips doesn't support language prefix in url (example: http://localhost/en/modules/click_heatmap/clickheat/click.php?s=...)

#1

maximust - March 4, 2008 - 11:21

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

boombatower - March 7, 2008 - 00:19

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

boombatower - March 9, 2008 - 20:13
Status:active» fixed

I made the necessary changes for the 5.x and 6.x branches.

Use the new release 2.3.

#4

boombatower - March 11, 2008 - 21:40
Assigned to:Anonymous» boombatower

#5

Anonymous (not verified) - March 25, 2008 - 21:42
Status:fixed» closed

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

#6

Sylvain Lasnier - September 25, 2009 - 10:25
Version:5.x-2.2» 6.x-2.5

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

Sylvain Lasnier - September 27, 2009 - 10:45
Status:closed» active

#8

boombatower - September 28, 2009 - 06:04
Version:6.x-2.5» 6.x-2.x-dev
Status:active» postponed (maintainer needs more info)

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:

<?php
return 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:

<?php
if ($language->prefix != '') {
?>

to
<?php
if ($language->prefix) {
?>

#9

Sylvain Lasnier - September 28, 2009 - 12:25

Wonderfull Jimmy,
This problem is solved by the dev release.

Thanks
Sylvain

#10

boombatower - September 28, 2009 - 18:49
Status:postponed (maintainer needs more info)» fixed

Ok, great.

#11

System Message - October 12, 2009 - 18:50
Status:fixed» closed

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

#12

stilblütler - November 29, 2009 - 17:51
Status:closed» active

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.

 
 

Drupal is a registered trademark of Dries Buytaert.