Closed (fixed)
Project:
Rules
Version:
6.x-1.0-beta2
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
23 Sep 2008 at 15:21 UTC
Updated:
23 Sep 2008 at 16:28 UTC
Hi, unsure if this is a bug or just me missing something, as I'm completely new to Rules.
I'm porting over the Userpoints workflow_ng module to a Rules include.
The action is certainly acknowleged, as the select box on the add action page does create a new entry. However that entry is blank, and is right at the top of the list, not under any module header. (see attached image)
I've included the html output below, check out the first option tag in the select - it has the right value, but no text. If I select this, then I just get an error on the next page.
<select name="name" class="form-select required" id="edit-name-1" >
<option value="rules_core_userpoints_action_grant_points"></option>
<optgroup label="Node">
<option value="rules_action_add_node">Add new content</option>
---------code snipped to keep this compact--------
</optgroup>
</select>
I've included the php code below.
Any ideas?
//file: userpoints.rules.inc
/**
* Implementation of hook_action_info().
*/
function userpoints_action_info() {
return array(
'userpoints_action_grant_points' => array(
'label' => t('Grant points to a user'),
'arguments' => array(
'user' => array('type' => 'user','label' => t('User') )
),
'module' => 'Userpoints',
'eval input' => array('points')
)
);
}
/**
* Implementation of a rules action: grant points to a user
*/
function userpoints_action_grant_points($user, $settings){
userpoints_userpointsapi(array('uid' => $user->uid, 'points' => $settings['points']));
}
/**
* Implementation of a rules action: disables revision moderation.
*/
function userpoints_action_grant_points_form($settings = array(), &$form) {
$form['settings']['points'] = array(
'#type' => 'textfield',
'#title' => t('Number of points'),
'#default_value' => isset($settings['points']) ? $settings['points'] : '',
'#description' => t('The number of points to award')
);
}
| Comment | File | Size | Author |
|---|---|---|---|
| Add | Testing123.jpg | 42.27 KB | andru-1 |
Comments
Comment #1
andru-1 commentedWith a red face, consider this closed. After half a day of frustrated meddling, I noticed I'm missing '_rules_' from the function names.