Hello. I got problem when I try to make rule using ROLE_EXPIRE module.

I created rule and choose event "User has logged in". After this I tried to add Action and I was expecting form. But nothing appears when page load finished. So I go to the reports and looked recent log.

The log message was :
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'role_expire_rules_action_set_role_expire_form' not found or invalid function name in FacesExtendable->__call() (line 123 of /path/to/drupal7/sites/all/modules/rules/includes/faces.inc).

I've attached screenshot of the result when I try to add ROLE_EXPIRE action to the rule.

It seems role_expire.rules.inc is including 'role_expire_rules_action_set_role_expire_form' but drupal cant find it ?

Help me for this.

Comments

togsbayar’s picture

Title: Problem when try to add ROLE_EXPIRE action to the role. » Problem when try to add ROLE_EXPIRE action to the RULE.
earth1’s picture

Version: 7.x-1.0-beta2 » 6.x-1.11
Assigned: Unassigned » earth1
Priority: Normal » Critical
StatusFileSize
new29.88 KB
new23.53 KB

version 6.x-1.11

Hello. I have a problem when I try to make a rule using ROLE_EXPIRE module.

Role expiration date/time is today's date (Capture1_3.JPG). The correct date is (Capture2_1.JPG).

Thank you,

ryan88’s picture

bump

Exact same problem. Any fixes?

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'role_expire_rules_action_set_role_expire_form' not found or invalid function name in FacesExtendable->__call() (line 123 of public_html/sites/all/modules/rules/includes/faces.inc).

Using Drupal 7.10

alexiswatson’s picture

Version: 6.x-1.11 » 7.x-1.0-beta2
Assigned: earth1 » Unassigned

Confirmed the issue in 7.x-1.0-beta2 (EDIT: also in the latest 7.x-1.0-dev), with the same UI behavior as above and the following logged to watchdog:

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'role_expire_rules_action_set_role_expire_form' not found or invalid function name in FacesExtendable->__call() (line 123 of /path/to/modules/contrib/rules/includes/faces.inc).

@3: Just a few quick tips for navigating the issue queues. First, your issue doesn't seem related to this one: you'll have much better luck creating your own issue after searching the issue queue to see if someone else already opened one with the problem you describe. Also, the "Assigned" field is only used when you want to take ownership of an issue, either the whole thing or the next step. The Issue Queue Handbook explains all this and more.

alexiswatson’s picture

Title: Problem when try to add ROLE_EXPIRE action to the RULE. » Role Expire 7.x doesn't use Rules 2.0 API
Status: Active » Needs review
StatusFileSize
new4.24 KB

Turns out the rules plugin was still written for Rules 1.0, and needed a rewrite. Updated this in the following patch. If the client requires them, I might add a few more actions and conditions in future patches. Note that strtotime is already called on the stored date value by the time the set action fires.

Review and feedback welcome!

alexiswatson’s picture

StatusFileSize
new7.21 KB

Added two more actions that the client needed: one for setting a role's expiry to the latest expiry of roles attached to a given user, and another for adding an extension to an existing expiry based on a relative timespan rather than simply setting it (relative dates are otherwise relative to time()). Very handy for managing role subscriptions via Drupal Commerce!

manischewitzbacon’s picture

patched and tested and happy - if you're ever in portland, OR davidwatson, I'll buy you a beer

ptmkenny’s picture

I tried to apply the patch in #7 using the following command:

git apply -v 1370262--role-expire-rules-2--7.patch

But I experienced the following error:
L7:role_expire patrick$ git apply -v 1370262--role-expire-rules-2--7.patch
1370262--role-expire-rules-2--7.patch:136: trailing whitespace.
* Action: Set expire time for role to longest attached to this user. Defaults
1370262--role-expire-rules-2--7.patch:143: trailing whitespace.
$this_ts = role_expire_get_user_role_expiry_time($account->uid, $id);
Checking patch role_expire/role_expire.rules.inc...
error: role_expire/role_expire.rules.inc: No such file or directory

user654’s picture

.

user654’s picture

.

stewsnooze’s picture

Drupal uses git now. You should probably try to commit it using git apply -v [patch-name.patch] however I doubt it will apply as the patch is out of date.

stewsnooze’s picture

Status: Needs review » Needs work

I take that back. This patch may still apply

user654’s picture

.

alexiswatson’s picture

When and where are you seeing the error messages? Having more information and steps to duplicate the problem would help greatly.

By the way, d.o patches are -p1 now, not -p0, to be more compatible with git.

user654’s picture

.

stewsnooze’s picture

Status: Needs work » Fixed

Committed to GIT 7.x-1.x Thanks davidwatson

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Marc Storms’s picture

I installed role_expire-7.x-1.0-beta2.tar and changed the role_expire.rules.inc with
http://drupalcode.org/project/role_expire.git/blob/0c3c0f19923f42977ad43...

Unfortunately I am receiving an "Unknown action role_expire_rules_action_extend_role_expire."
and the log messages read like
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'role_expire_rules_action_set_role_expire_form' not found or invalid function name in FacesExtendable->__call() (line 123 of /home/abrainfo/www/sites/all/modules/rules/includes/faces.inc).

jtibbles’s picture

Title: Role Expire 7.x doesn't use Rules 2.0 API » Role Expire 7.x UI missing, no ability to set/view vaues
Status: Closed (fixed) » Active
StatusFileSize
new56.26 KB

Using Commerce Kickstat 7.x-2.7. Added Role Expire module. Have a rule that switches users to a particular role on purchase. That role then needs an expiry date set. Using rules I choose any of the role expire options (already patched the dropdown using previously recommended patches, however this issue was present before the patch). The UI then goes blank (see attached

Also setting expiry times through "roles" didn't seem to work either, but atleast it let me fill in the details, even though those details are ignored.

alexiswatson’s picture

Title: Role Expire 7.x UI missing, no ability to set/view vaues » Role Expire 7.x doesn't use Rules 2.0 API
Status: Active » Closed (fixed)

Hi jtibbles,

First, welcome! Generally speaking, issues remain closed unless the fix itself was incomplete. If the issue was already present before the patch and doesn't seem to be related, you'll probably have better luck opening a new issue if one doesn't match your exact problem. All this and more can be found in the issue queue documentation.