test ajax_deliver

This commit is contained in:
Nathan Coad
2018-05-02 15:29:18 +10:00
parent a12351c15e
commit a507c3f219

View File

@@ -161,12 +161,14 @@ function booking_variety_session_callback($form, &$form_state) {
//$form['variety-sessions'][$fieldname]['#title'] = t('Rebuilt Variety Session: ' . $timeslot->booking_variety_time_descrip); //$form['variety-sessions'][$fieldname]['#title'] = t('Rebuilt Variety Session: ' . $timeslot->booking_variety_time_descrip);
// Tell drupal to update the wrapper for this field // Tell drupal to update the wrapper for this field
//$commands[] = ajax_command_replace('#booking_variety_session_' . $timeslot->tid . '_wrapper', drupal_render($form[$fieldname])); $commands[] = ajax_command_replace('#booking_variety_session_' . $timeslot->tid . '_wrapper', drupal_render($form[$fieldname]));
$commands[] = ajax_command_replace('#booking_variety_session_' . $timeslot->tid . '_wrapper', drupal_render($form)); //$commands[] = ajax_command_replace('#booking_variety_session_' . $timeslot->tid . '_wrapper', drupal_render($form));
} }
//$form_state['rebuild'] = TRUE; //$form_state['rebuild'] = TRUE;
return array('#type' => 'ajax', '#commands' => $commands); //return array('#type' => 'ajax', '#commands' => $commands);
$page = array('#type' => 'ajax', '#commands' => $commands);
ajax_deliver($page);
} }
@@ -188,7 +190,7 @@ function _booking_get_variety_timeslot_options($timeslot_id) {
$session_options[$session->vid] = $session->booking_variety_descrip; $session_options[$session->vid] = $session->booking_variety_descrip;
} }
} }
watchdog('booking_debug', "<pre>Variety Session Options:\n@info</pre>", array('@info' => print_r( $session_options, true))); //watchdog('booking_debug', "<pre>Variety Session Options:\n@info</pre>", array('@info' => print_r( $session_options, true)));
return $session_options; return $session_options;
} }