This commit is contained in:
Nathan Coad
2016-06-03 10:28:45 +10:00
parent cf636af9fe
commit 6c1eb2528b
2 changed files with 8 additions and 4 deletions

View File

@@ -339,7 +339,7 @@ function booking_manual_email_form($form, &$form_state, $input_option = "")
$form['booking-email-default-ids'] = array (
'#type' => 'hidden',
'#value' => "",
'#value' => "[]",
'#prefix' => '<div id="booking_email_default_ids_wrapper">',
'#suffix' => '</div>',
'#attributes' => array('id' => 'booking_email_default_ids'),
@@ -490,12 +490,15 @@ function _booking_email_get_default_selection_callback($form, $form_state) {
'#value' => drupal_json_encode($defaults),
'#prefix' => '<div id="booking_email_default_ids_wrapper">',
'#suffix' => '</div>',
);
'#attributes' => array('id' => 'booking_email_default_ids'),
);
$output_html = render($replacementform_data['booking-email-default-ids']);
watchdog('booking_debug', "<pre>Manual Email ajax html\n@info</pre>", array('@info' => print_r( $output_html, true)));
return array(
'#type' => 'ajax',
'#commands' => array(
ajax_command_replace("#booking_email_default_ids_wrapper", render($replacementform_data['booking-email-default-ids'])),
ajax_command_replace("#booking_email_default_ids_wrapper", $output_html)),
array('command' => 'bookingEmailIDs'), // This will call the command nameOfCommand we just created in the JS file.
)
);