I have set up UC Role Progression, then made adjustments to the predicate conditions, and also edited the notification message. I have added PHP snippets to the email and don't know if what I've done is working properly.

How would I go about testing my role progression settings without waiting a week for the trigger to fire? I thought I saw something about how to do this, but now I can't find it anywhere.

Comments

mirabuck’s picture

Component: Miscellaneous » Code
Assigned: Unassigned » mirabuck
Category: support » feature

Hi LPecunia,

You raise a very good point. Using weeks as a measure isn't very granular anyway. I wasn't thinking too far outside my own use case when I wrote this and should probably bring this in line with UC Roles which allows for expiry based on a global setting, an absolute date, or a relative date set in days, weeks, months or years.

I'll see if I can put together a dev version of the module that addresses this.

Many thanks,

Mirabuck

mirabuck’s picture

Oh, and to properly answer your question: no, there isn't a mechanism that would allow you to easily test this currently.

Mriabuck

mirabuck’s picture

Assigned: mirabuck » Unassigned
Status: Active » Needs review

As an initial step forward I've created a 6.x-1.x-dev development release which will allow users to chose between days and weeks when setting role expirations. It should make testing much easier and shouldn't cause any issues for users who have another version of the module installed already. I'd appreciate feedback from anyone who has the time to install and test it.

Mirabuck

LPecunia’s picture

Thank you for the quick response, Mirabuck. I will try to test this as soon as I get a chance.

mirabuck’s picture

Issue summary: View changes
Status: Needs review » Closed (won't fix)

Three years and no update on this. Folks that want this functionality are welcome to use the latest dev. I don't think there's much point putting together a full release for this given that I'm committed to just doing maintenance fixes.

nlahm’s picture

I installed and successfully tested the 6.x-1.x-dev development release.

To test , I gave the first role of the progression to my test user for 1 day. I started the cron which has enabled conditional action about an upcoming expiration . In phpMyAdmin , table uc_roles_expiration , expiration field , I subtract 90000 to the value which made the expiration date earlier than the current date . I started the cron which enabled the conditional action role expired. I reiterated for the whole progression.

I had to add a line in the file uc_roles.modules, in uc_roles_cron function ()

...
/ / Role expired .
    elseif ($expiration -> expiration <= $ time ) {
      ca_pull_trigger (' uc_roles_notify_revoke ', $account , $expiration) ;
      / / Add this line because $account is not passed by reference in the callback calls and is not updated
      $account = user_load ( $account -> uid) ;
      uc_roles_revoke ( $account , $expiration -> rid) ;
    }
...