As far as I can see it's not possible to trigger a field on the comments form based on a value in a node?
Is this possible in the future?

Comments

peterpoe’s picture

It's not possible for now, and it's not a planned feature, but I would certainly accept patches about it.

peterpoe’s picture

Title: Dependent field on comments form based on value cck field in node » Allow dependencies between fields from different entities
Status: Active » Postponed
liquidcms’s picture

Status: Postponed » Active

i think this is my same use. i would like to have fields dependent on a field value in a different node.

specifically an OG setup where i have a type field for my OG group node and would like to have conditional fields on a group content node within that group dependent on that type setting.

i wonder if a generic solution for these cases wouldn't be a PHP dependee field?

at first i thought Computed Field might do the trick as it could be set to match the OG group's type setting but this will only be filled on initial node submit so i can't make it work for node/add only for node/edit

perhaps a simple hidden field and a form_alter to fill might work? failing this i may look at adding my idea of a PHP Dependee.

liquidcms’s picture

hidden field with a form_alter seems to work well.

astanley86’s picture

Can you explain how to set this up? What would the form_alter code look like? This would be a very nice feature. Thanks.

liquidcms’s picture

don't think we ended up using this approach in the end; but pretty simple concept (although would still be nice if this module supported it)

i simply have fields on node of type X that i want to be dependent on a field of a parent node (node of type Y - i.e. OG).

in other words, from my example:

- node type Building (OG node), contains nodes of type Survey (building is parent of survey)
- i have fields on a Survey that i want to be conditional on a field (building type) in the Building that this Survey belongs to
- add a field to Survey called building type.

in form alter code set:
- building type field in Survey to match that of the same field in the Building node it belongs to
- hide this field
- set up conditional fields to be dependent on this field (in Survey)

$form['field_buildingtype']['und']['#default_value'][0] = function_to_find_value_in_building(); 
$form['field_buildingtype']['und']['#type'] = 'hidden'; 
dqd’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Thanks for the report and all the efforts in here. But due to inactivity in this issue for some years and because of the upcoming EOL of Drupal 7, I will close this issue on the way by cleaning up the issue queue.

Feel free to re-open as "Needs review" if you found a solution or have a patch to be reported to help others on this outdated version.

If you think this issue or missing feature should be addressed in a newer Drupal core 8 and above compatible version of this project, then please file a new issue to the latest dev.