summaryrefslogtreecommitdiff
path: root/modules/simpletest/tests/ajax_forms_test.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-04-30 08:07:55 +0000
committerDries Buytaert <dries@buytaert.net>2010-04-30 08:07:55 +0000
commit8c08ea2561b6da5a97777312ebf60d295dbbdb1e (patch)
tree5502b1254664920ff775b717cab4c136239ebb08 /modules/simpletest/tests/ajax_forms_test.module
parent466f693276617c8def2c72601c402e7be4b21ad0 (diff)
downloadbrdo-8c08ea2561b6da5a97777312ebf60d295dbbdb1e.tar.gz
brdo-8c08ea2561b6da5a97777312ebf60d295dbbdb1e.tar.bz2
- Patch #645800 by katbailey, effulgentsia, rfay: ajax_deliver() ignores #ajax['method'] and incorrectly forces 'replaceWith' for simple AJAX callbacks, D6-&gt;D7 regression.
Diffstat (limited to 'modules/simpletest/tests/ajax_forms_test.module')
-rw-r--r--modules/simpletest/tests/ajax_forms_test.module20
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/simpletest/tests/ajax_forms_test.module b/modules/simpletest/tests/ajax_forms_test.module
index 5de2b842c..db8aa3b92 100644
--- a/modules/simpletest/tests/ajax_forms_test.module
+++ b/modules/simpletest/tests/ajax_forms_test.module
@@ -186,6 +186,17 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) {
'#suffix' => '<div id="html_div">Original contents</div>',
);
+ // Shows the AJAX 'insert' command.
+ $form['insert_command_example'] = array(
+ '#value' => t("AJAX insert: Let client insert based on #ajax['method']."),
+ '#type' => 'submit',
+ '#ajax' => array(
+ 'callback' => 'ajax_forms_test_advanced_commands_insert_callback',
+ 'method' => 'prepend',
+ ),
+ '#suffix' => '<div id="insert_div">Original contents</div>',
+ );
+
// Shows the AJAX 'prepend' command.
$form['prepend_command_example'] = array(
'#value' => t("AJAX 'prepend': Click to prepend something"),
@@ -321,6 +332,15 @@ function ajax_forms_test_advanced_commands_html_callback($form, $form_state) {
}
/**
+ * AJAX callback for 'insert'.
+ */
+function ajax_forms_test_advanced_commands_insert_callback($form, $form_state) {
+ $commands = array();
+ $commands[] = ajax_command_insert('#insert_div', 'insert replacement text');
+ return array('#type' => 'ajax', '#commands' => $commands);
+}
+
+/**
* AJAX callback for 'prepend'.
*/
function ajax_forms_test_advanced_commands_prepend_callback($form, $form_state) {