Conditional actions is fighting hard against my will to add additional information to some predicates.
(1) CA doesn't use drupal_write_record(), so you cannot simply add a column to the database
(2) There is a hook_ca_predicate_alter(), but it is only called for predicates stored in code
(3) ca_predicate_meta_form_submit() only saves the default predicate fields, so you cannot hook_form_alter() that to add additional meta-data to the predicate anyway.
I suggest we add a $predicate['#data'] field, and make sure that other modules can use that to store additional meta-data. It's the less intrusive change that I can think of.
Comments
Comment #1
damien tournoud commentedHere is a (minimal) patch.
Comment #2
damien tournoud commentedSmall correction: we also need to save the predicate_data value in ca_predicate_meta_form_submit().
Comment #3
longwaveI was looking for a similar feature, but I was looking to alter default predicates rather than add metadata. However, (2) confused me - there is no hook_ca_predicate_alter() as far as I can see. The attached patch adds this.
Comment #4
longwaveCommitted #3.
#2 is over a year old, I currently have no use for this and am not sure I can see the need - what "extra information" do you need to add to predicates? - but I will consider committing if someone still finds it useful.
Comment #5
longwavePlease reopen with an example use case if this is still required.