Closed (fixed)
Project:
Context
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
13 Feb 2012 at 17:17 UTC
Updated:
23 Nov 2020 at 14:58 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
recidive commentedJust got around this by returning a simple array with the context as return for condition_form() and did everything else in a hook_form_alter().
Comment #2
dobe commentedI did the same thing for the context reactions. A demonstration of this can be found in the Chardin module.
Comment #3
wesleymusgrove commentedI spent some time struggling with this very issue. Other than what was provided in the Chardin module, I could barely find any other documentation for needing to refresh portions of a context condition form via Ajax whatsoever. I referenced the Chardin module, plugins from the Context contributed module, and the simple Ajax-enabled forms example here: https://www.drupal.org/node/752056.
I couldn't get this ajax functionality to work using the typical
condition_values(),condition_form(), oroptions_form()functions, which is why I went forward with adapting thehook_form_FORM_ID_alter()as seen in the Chardin module.I had to put the
howmany_selectand thecheckboxes_fieldsetinside the$form['conditions']['plugins']['example_condition']['values']array, which mimicked the way values get stored in the form if you do it the traditional way usingcondition_values(),condition_form()functions.NOTE: I don't know why, but the
condition_form_submit($values)function was still required in order to correctly submit and save values set inexample_form_ctools_export_ui_edit_item_form_alter. Otherwise$form_state['item']->conditions['example_condition']['values']did not contain the correct values.Comment #4
paulocsThanks for the explanation @wesleymusgrove.
I'm closing this issue.
Comment #5
paulocsComment #6
paulocs