Commit 16180068 authored by Steven Jones's avatar Steven Jones

Issue #1348338 by helmo, Steven Jones: Fixed Ajax requests ignore base_url() setting - followup.

parent 15d5e0e5
......@@ -68,6 +68,13 @@ function _hosting_site_field(&$form, $node, $item, $element, $filter_display ='f
* Add the needed .js and .css files to render the form correctly before printing it
*/
function _hosting_site_form_pre_render($elements) {
static $settings_added = FALSE;
if (!$settings_added) {
$settings_added = TRUE;
$setting = array();
$setting['hosting']['site']['form_check_url'] = url('hosting/hosting_site_form_check');
drupal_add_js($setting, 'setting');
}
drupal_add_js(drupal_get_path('module', 'hosting_site') . '/hosting_site.form.js');
return $elements;
......
......@@ -168,7 +168,7 @@ Drupal.hosting.siteFormCheck = function(element) {
$.ajax({
type: 'POST',
url: '/hosting/hosting_site_form_check',
url: Drupal.settings.hosting.site.form_check_url,
data: post_data,
// Handle the success callback.
success: function(data) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment