From 7cf3518b64b40ba08fdf605d7f72e19b9e8b9841 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 20 Oct 2010 15:22:53 +0000 Subject: - Patch #926016 by effulgentsia, chrisshattuck: several bugs when trying to remove files from a multivalued file/image field. --- modules/simpletest/drupal_web_test_case.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'modules/simpletest/drupal_web_test_case.php') diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php index 67533c81e..e52f0cad9 100644 --- a/modules/simpletest/drupal_web_test_case.php +++ b/modules/simpletest/drupal_web_test_case.php @@ -1801,7 +1801,7 @@ class DrupalWebTestCase extends DrupalTestCase { * * @see ajax.js */ - protected function drupalPostAJAX($path, $edit, $triggering_element, $ajax_path = 'system/ajax', array $options = array(), array $headers = array(), $form_html_id = NULL, $ajax_settings = NULL) { + protected function drupalPostAJAX($path, $edit, $triggering_element, $ajax_path = NULL, array $options = array(), array $headers = array(), $form_html_id = NULL, $ajax_settings = NULL) { // Get the content of the initial page prior to calling drupalPost(), since // drupalPost() replaces $this->content. if (isset($path)) { @@ -1838,6 +1838,12 @@ class DrupalWebTestCase extends DrupalTestCase { $extra_post .= '&' . urlencode('ajax_html_ids[]') . '=' . urlencode($id); } + // Unless a particular path is specified, use the one specified by the + // AJAX settings, or else 'system/ajax'. + if (!isset($ajax_path)) { + $ajax_path = isset($ajax_settings['url']) ? $ajax_settings['url'] : 'system/ajax'; + } + // Submit the POST request. $return = drupal_json_decode($this->drupalPost(NULL, $edit, array('path' => $ajax_path, 'triggering_element' => $triggering_element), $options, $headers, $form_html_id, $extra_post)); -- cgit v1.2.3