Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Due to a simple wording error, the second argument to ajax_command_changed() (to mark a div with an asterisk) doesn't work. The attached patch fixes it.
This is a followon to #544418: Integrate CTools AJAX framework with Drupal to extend (and replace) existing ahah framework, where this command was introduced.
Comment | File | Size | Author |
---|---|---|---|
#4 | ajax_changed_command_fix_with_tests_623310_04.patch | 3.59 KB | rfay |
ctools_asterisk_bug_01.patch | 343 bytes | rfay | |
Comments
Comment #1
rfayThe Examples module AJAX Example now provides a testbed for this. Use the "AJAX Example: Advanced Commands" menu.
Comment #2
katbailey CreditAttribution: katbailey commentedFor anyone else looking at this, it's a hard one to test while this issue is still outstanding: #622922: User input keeping during multistep forms. ($form_state['values']['changed_command_example'] is always empty so the asterisk doesn't get added).
However, if I remove the dependency on anything in $form_state['values'] in the callback, I confirm that the asterisk does get added, whereas it doesn't without the patch.
Comment #3
webchickI can haz tests?
Comment #4
rfay@webchick, you now haz tests. Lots of tests.
This patch adds a test for the asterisk portion. The main portion was already covered by the other issue.
Comment #5
webchickExcellent!
Committed to HEAD, with a couple of small whitespace fixes.