I'm missing a 'value' property that will allow me to silently pass a value.
My use case is taxonomy integration and the use of 'base' property. I'd like my form to know which vocab has been chosen.
Notice the use of 'value' => $vocabulary->vid,:
/**
* Implementation of hook_rules_action_info().
*/
function taxonomy_rules_action_info() {
$info = array();
// Get existing taxonomy vocabulries.
$vocabularies = taxonomy_get_vocabularies();
foreach ($vocabularies as $vocabulary) {
$info['rules_action_taxonomy_assign_term_to_content_'. $vocabulary->vid] = array(
'label' => t('Assign a term from vocabulary "') . $vocabulary->name . t('" to content'),
'arguments' => array(
'node' => array(
'type' => 'node',
'label' => t('Content which term will assigned to')),
),
'base' => 'rules_action_taxonomy_assign_term_to_content',
'value' => $vocabulary->vid,
'description' => t('Assign a certain taxonomy term to the content.'),
'module' => 'Taxonomy',
);
}
return $info;
}
Comments
Comment #1
amitaibuMaybe better to put value in arguments:
So it is loaded as an argument.
Comment #2
fagointeresting idea. Note that your first example works already - I've done the same if you have a look at rules_rules_action_info() where i pass the set_name and read it out from $element['#info'] later on.
However I like the idea of adding it as "fixed" argument.
Comment #3
fagoI've just implemented this.
It works with the data type 'value'
Furthermore there is now support for 'default value' for every data type :)
Comment #4
amitaibuAwesome! :)
Comment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #6
mitchell commentedUpdated component.