summaryrefslogtreecommitdiff
path: root/modules/simpletest
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-10-20 15:22:53 +0000
committerDries Buytaert <dries@buytaert.net>2010-10-20 15:22:53 +0000
commit7cf3518b64b40ba08fdf605d7f72e19b9e8b9841 (patch)
treece75f084373615bb06c30985317e70581269519a /modules/simpletest
parentaf2b5e7d86a94fc7d0834e2ef0e44036d28cae3b (diff)
downloadbrdo-7cf3518b64b40ba08fdf605d7f72e19b9e8b9841.tar.gz
brdo-7cf3518b64b40ba08fdf605d7f72e19b9e8b9841.tar.bz2
- Patch #926016 by effulgentsia, chrisshattuck: several bugs when trying to remove files from a multivalued file/image field.
Diffstat (limited to 'modules/simpletest')
-rw-r--r--modules/simpletest/drupal_web_test_case.php8
1 files changed, 7 insertions, 1 deletions
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));