summaryrefslogtreecommitdiff
path: root/includes/ajax.inc
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-10-18 05:14:39 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-10-18 05:14:39 +0000
commit2484439643f86cbc2da3b4f391eb3e23e51fc94d (patch)
tree97fbddc1ba1f9c1921ea131870acd39ebec7732b /includes/ajax.inc
parentbba83fc6846b1530be180fb56a060fd31d4d13cc (diff)
downloadbrdo-2484439643f86cbc2da3b4f391eb3e23e51fc94d.tar.gz
brdo-2484439643f86cbc2da3b4f391eb3e23e51fc94d.tar.bz2
#595654 by sun: Fixed AJAX command 'settings' (with tests).
Diffstat (limited to 'includes/ajax.inc')
-rw-r--r--includes/ajax.inc6
1 files changed, 3 insertions, 3 deletions
diff --git a/includes/ajax.inc b/includes/ajax.inc
index 0cd6f63e6..2701cb0ab 100644
--- a/includes/ajax.inc
+++ b/includes/ajax.inc
@@ -142,7 +142,7 @@ function ajax_render($commands = array(), $header = TRUE) {
// them the first command.
$scripts = drupal_add_js(NULL, NULL);
if (!empty($scripts['settings'])) {
- array_unshift($commands, ajax_command_settings($scripts['settings']['data']));
+ array_unshift($commands, ajax_command_settings(call_user_func_array('array_merge_recursive', $scripts['settings']['data'])));
}
// Allow modules to alter any AJAX response.
@@ -156,7 +156,7 @@ function ajax_render($commands = array(), $header = TRUE) {
// http://malsup.com/jquery/form/#code-samples
print '<textarea>' . drupal_json_encode($commands) . '</textarea>';
}
- else if ($header) {
+ elseif ($header) {
drupal_json_output($commands);
}
else {
@@ -773,7 +773,7 @@ function ajax_command_css($selector, $argument) {
function ajax_command_settings($argument) {
return array(
'command' => 'settings',
- 'argument' => $argument,
+ 'settings' => $argument,
);
}