diff --git a/mollom.js b/mollom.js index 01032a9..54c0dfa 100644 --- a/mollom.js +++ b/mollom.js @@ -38,7 +38,7 @@ function getMollomCaptcha() { // Retrieve a new CAPTCHA. $.ajax({ - url: Drupal.settings.basePath + path, + url: Drupal.settings.basePath + Drupal.settings.mollomPathPrefix + path, type: 'POST', dataType: 'json', success: function (data) { diff --git a/mollom.module b/mollom.module index 1ea0ca9..0c65e24 100644 --- a/mollom.module +++ b/mollom.module @@ -1711,6 +1711,15 @@ function mollom_process_mollom($element, $input, &$form_state, &$complete_form) // Add the JavaScript. drupal_add_js(drupal_get_path('module', 'mollom') . '/mollom.js'); + // D7 backport: Provide the language-specific path prefix, if any. + // @see drupal_add_js() + // Note: D6 uses array_merge_recursive() for JS settings of all modules; the + // setting must be namespaced to prevent the value from being converted into + // an array in case multiple modules have backported this gem. + url('', array('prefix' => &$prefix)); + drupal_add_js(array( + 'mollomPathPrefix' => empty($prefix) ? '' : $prefix, + ), 'setting'); // Add the Mollom session data elements. // These elements resemble the {mollom} database schema. The form validation