This patch creates a new function which extracts the right form values array from the $form_state so that every function that needs values gets right array. Additionally the settings form array always uses #tree = TRUE. This improvements will allow developers to embed the rules form from rules components correctly.
I also enabled AJAX for the add more button in the variable settings, since the issue #756762: AJAX should follow same rules for whether to call drupal_rebuild_form() as non-AJAX submissions has been fixed.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | rules-1250724-2.patch | 10.78 KB | sepgil |
| extracting_values.patch | 10.64 KB | sepgil |
Comments
Comment #1
fago>+ if (isset($value_state['provides'])) {
$value_state isn't a fitting variable name ;) Let's just use $values, or $form_values.
> // Enable AJAX once #756762 is fixed.
- // '#ajax' => rules_ui_form_default_ajax('none'),
+ '#ajax'
Does that work? IF yes, remove the comment too.
>Returns the right form values array from the $form_state.
Let's shortly describe that this is necessary if form is embedded somewhere.
Else the patch looks good to me.
Comment #2
sepgil commentedCorrected the issues.
Comment #3
sepgil commentedComment #4
fagoI fixed the comment to be like that.
Also, I've done some improvements like directly passing $form['settings'] and fixing the function when called during $form generation + I fixed a validation problem.
Committed it, thanks.
Comment #5
sepgil commentedAdded GSoC tag.