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.

#1 locale_jquery_compatibility_mode.zip3.52 KBigor.ro


igor.ro’s picture

new3.52 KB

Here is a module that fixes this bug.

igor.ro’s picture

Status:Active» Needs review
crystaldawn’s picture

Status:Needs review» Reviewed & tested by the community

Hmmm 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.

crystaldawn’s picture

Status:Reviewed & tested by the community» Closed (fixed)

This 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)