When we enable locale.module it runs locale_update_js_files() function to apply actual language to all js files.
This module uses Locale.inc and have conflict with this jquery_compatebility_mode module.
locale.module contains such code
// The first three parameters are NULL in order to get an array with all
// scopes. This is necessary to prevent recreation of JS translation files
// when new files are added for example in the footer.
$javascript = drupal_add_js(NULL, NULL, NULL);
$files = $new_files = FALSE;
foreach ($javascript as $scope) {
foreach ($scope as $type => $data) {
if ($type != 'setting' && $type != 'inline') {
foreach ($data as $filepath => $info) {
$files = TRUE;
if (!in_array($filepath, $parsed)) {
// Don't parse our own translations files.
if (substr($filepath, 0, strlen($dir)) != $dir) {
locale_inc_callback('_locale_parse_js_file', $filepath);
watchdog('locale', 'Parsed JavaScript file %file.', array('%file' => $filepath));
$parsed[] = $filepath;
$new_files = TRUE;
}
}
}
}
}
}
because we override drupal_add_js
this sting gets wrong path to files.
$javascript = drupal_add_js(NULL, NULL, NULL);
For example it returns such path /jquery_compatibility_mode/sites/all/modules/custom/test_module/test_module.js
But realy this file have such path /sites/all/modules/custom/test_module/test_module.js
locale_inc_callback('_locale_parse_js_file', $filepath);
this function gets js file content by fread function. And because of wrong path we have error.
Comments
Comment #1
igor.ro commentedHere is a module that fixes this bug.
Comment #2
igor.ro commentedComment #3
crystaldawn commentedHmmm I will add this to the project as an addon module and a check in the main module to enable/disable it whenever it notices the locale module running.
Comment #4
crystaldawn commentedThis is now an addon module that enables and disables itself whenever the locale module is enabled/disabled. Thanx for the submission. The new addon module is in the 6-1-6 release (v 1.6)