TwoD found a major bug in ajax_command_settings() as well as ajax_render().

1) ajax.js is trying to access the key "settings", but "argument" is sent via JSON.

2) ajax_render() doesn't merge the settings like http://api.drupal.org/api/function/drupal_get_js/7 does, so you get an unprocessed array of settings. ;)

Attached patch fixes that.

Comments

twod’s picture

Status: Needs review » Reviewed & tested by the community

Tested the patch and it works perfectly now.

webchick’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

Let's add some tests for this.

sun’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new7.06 KB

Reminder: YOU requested that. Yes, YOU! Good news: There are no AJAX framework tests at all yet. Have fun reviewing! *ggg*

sun’s picture

Issue tags: -Needs tests +D7 API clean-up

.

katbailey just ran into the same bug while porting a module. Please commit.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the ping. This fell off my radar.

Committed to HEAD.

twod’s picture

Great, thanks!

Status: Fixed » Closed (fixed)
Issue tags: -API clean-up, -D7 API clean-up

Automatically closed -- issue fixed for 2 weeks with no activity.