Pageear not working properly in multilingual website
| Project: | PageEar |
| Version: | 6.x-2.0-rc2 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | manfer |
| Status: | closed |
Jump to:
Pageear is not working in a multilingual website.
In module code, before passing media paths to javascript, I was trying to convert all paths from relative to absolute using the drupal api function url. That seems to be an error. That function seems to be language dependant or maybe I don't know how to make it not be so.
As an example let say I have my drupal installation at www.example.com, if I have a media with relative path "sites/all/files/example.jpg" after I aply url function trying to convert that to an absolute path it works on a non multilingual site. The return value of function would be:
http://www.example.com/sites/all/files/example.jpg
The problem comes on most multilingual sites. In those sites the url function is not correct. Let's say we have a multilingual site with english default language and spanish an french versions. If we are looking the website in default language, english, the path to media after applying url function would still be:
http://www.example.com/sites/all/files/example.jpg
but for spanish and french versions it would be:
http://www.example.com/es/sites/all/files/example.jpg
http://www.example.com/fr/sites/all/files/example.jpg
incorrect paths for that media. Though we are looking the website in other language, the media is still on same path not other.
Only multilingual website with language negotiation set to none would work by now, 6.x-2.0-rc2 version.

#1
I'm going to get rid of that url function and prepend to the relative paths the function base_path() to make then "absolute".
Example:
$js .= "var flagSwf = '". url(drupal_get_path('module', 'pageear') .'/pageturn/flag', array('absolute' => TRUE)) ."';\n";would be change to:
$js .= "var flagSwf = '". base_path() . drupal_get_path('module', 'pageear') ."/pageturn/flag';\n";That way the code would work fine in a multilingual site. I would realease the corrected version as soon as posible.
#2
New release with fix available.
#3
Automatically closed -- issue fixed for 2 weeks with no activity.