summaryrefslogtreecommitdiff
path: root/modules/book
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-03-13 06:55:50 +0000
committerDries Buytaert <dries@buytaert.net>2010-03-13 06:55:50 +0000
commit5e32593f3d7c1dd7412e9f918efa3121ff9e6565 (patch)
tree25896319767e65552e98f7246c89748d9297ab20 /modules/book
parent1106db64560976f8baa1e7ebaa45fd7c4917c2e1 (diff)
downloadbrdo-5e32593f3d7c1dd7412e9f918efa3121ff9e6565.tar.gz
brdo-5e32593f3d7c1dd7412e9f918efa3121ff9e6565.tar.bz2
- Patch #716602 by effulgentsia: refactor ajax_render() and clean up 'ajax' element type.
Diffstat (limited to 'modules/book')
-rw-r--r--modules/book/book.pages.inc11
1 files changed, 2 insertions, 9 deletions
diff --git a/modules/book/book.pages.inc b/modules/book/book.pages.inc
index 832e1e3c5..0ff490abd 100644
--- a/modules/book/book.pages.inc
+++ b/modules/book/book.pages.inc
@@ -237,7 +237,6 @@ function book_form_update() {
// Load the form based upon the $_POST data sent via the ajax call.
list($form, $form_state) = ajax_get_form();
- $commands = array();
$bid = $_POST['book']['bid'];
// Validate the bid.
@@ -248,15 +247,9 @@ function book_form_update() {
$form['book']['plid'] = _book_parent_select($book_link);
form_set_cache($form['values']['form_build_id'], $form, $form_state);
- // Build and render the new select element, then return it in JSON format.
+ // Build the new select element and return it.
$form_state = array();
$form = form_builder($form['form_id']['#value'], $form, $form_state);
-
- $commands[] = ajax_command_replace(NULL, drupal_render($form['book']['plid']));
+ return $form['book']['plid'];
}
-
- // @todo: We could and should just return $form['book']['plid'] and skip the
- // ajax_command_replace() above. But for now, this provides a test case of
- // returning an AJAX commands array.
- return array('#type' => 'ajax_commands', '#ajax_commands' => $commands);
}