I noticed that the "more" link in the jCalendar popup doesn't point to the currently active language, but indead points to the default language. Later I noticed this is due to the ajax url that points to ?q=jcalendar/getnode/... instead of ?q=langcode/jcalendar/getnode/... where langcode would be en/fr/nl/de/...
when I briefly tested it by hardcoding the url to ?q=fr/jcalendar/getnode/... it seemed to work fine
I'm not sure if this is also the case in the latest dev versions. If not, I'll be glad to spit out a patch for it, just don't really know which version to patch against... HEAD doesn't seem to have jCalendar, so guess I'll patch against D6--2 branch
changed jcalendar_views_pre_view:
/**
* Override the calendar view to inject javascript.
* @param view Which view we are using.
* @return unknown as of yet.
*/
function jcalendar_views_pre_view(&$view, &$display_id) {
foreach ($view->display as $display) {
if ($display->display_plugin == 'calendar') {
$path = drupal_get_path('module', 'jcalendar');
drupal_add_js('var var_path = '. drupal_to_js(base_path() . $path) .";", 'inline');
drupal_add_js('var var_base_path = '. drupal_to_js((base_path())) .";", 'inline');
$getnode = '?q=';
if (module_exists('i18n')) {
$getnode .= i18n_get_lang();
$getnode .= '/';
}
$getnode .= 'jcalendar/getnode/';
drupal_add_js('var var_getnode_url = '. drupal_to_js($getnode).';', 'inline');
drupal_add_js($path .'/jcalendar.js');
drupal_add_css($path .'/jcalendar.css');
}
}
}
and in jcalendar.js:
// obviously it's js and not php
// fill the div with data
$.ajax({
type: "GET",
url: var_base_path + var_getnode_url +nid+"/"+id,
success: function(msg){
domCallback(msg);
}
});
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | calendar.427388.patch | 1.14 KB | jhedstrom |
| #4 | jcalendar.patch | 1.97 KB | seutje |
| jcalendar.patch | 1.58 KB | seutje |
Comments
Comment #1
seutje commentedComment #2
seutje commentedsolution doesn't work for sites that use a domain-based i18n setting
Comment #3
seutje commentedchanged it to
and now it seems to play nice with all locale settings, also I aggregated all the inline js into 1 variable and 1 drupal_add_js call
please review :)
Comment #4
seutje commentedconverted tabs to spaces and fixed a typo
Comment #5
Remon commentedit works. thanks
Comment #6
jhedstromWhy not simply use url()? The attached patch works for me with both localization issues and the purl module.
Comment #7
dddave commentedComment #8
Remon commentedComment #9
karens commented@Remon, are you saying you reviewed and tested the patch at #6 or the earlier patch? @dddave, did you test the patch at #6? That patch is much simpler and is the latest patch in this issue, so marking it reviewed and tested should mean that patch was reviewed and tested, but by just changing the status without making any comment about why you did it, I can't tell *what* was tested.
Comment #10
arlinsandbulte commentedLack of feedback for over 4 months.
Marking "won't fix"
Comment #11
jhedstromThis should not be closed. It's a relatively simple fix, and is very easy to reproduce the bug.
Comment #12
seutje commented@jhedstrom: dang, way to make me feel silly :P
tested with multiple different settings, and I can't seem to break it anymore, senks!
Comment #13
jhedstromThis appears fixed in the latest dev release.