This is my first ever support request on this website, so forgive me if I don’t give all the information you require in advance in order to answer this question. Please do say if you need more. I am running Drupal v.6.20 and Ubercart v.6.x-2.4.

This module appears to deliver exactly the functionality I require, which I don’t see with any other module, so kudos to you for providing it! However, I’’m not able to save all the settings and Im wondering if I’m doing something wrong? Here’s what I’m doing:

I want to deliver teaching materials online over a scheduled period, one part per month over three months. I have created roles as follows:

  • Student part 1 role
  • Student part 2 role
  • Student part 3 role
  • Graduate

The scheduled period should work as follows:

  • Granting Student part 1 role to a student gives them access to a View listing the files they need to download in month 1. This role should be given when purchasing the course through Ubercart.
  • After 1 month (or 4 weeks) has elapsed, the student should be granted Student part 2 role, which gives them access to a View listing files for months 1 and 2.
  • After a further month (or 4 weeks) has elapsed, the student should be granted Student part 3 role, which gives them access to a View listing files for months 1, 2 and 3.
  • After another month (or 4 weeks) they should then ‘fall off the conveyor belt’ and become a Graduate, which is really just a means of identifying that student as someone who’s received all three months-worth of materials. No further scheduling is required from here.

Not wishing to use the existing Conditional Action, Notify customer when a role is about to expire, I set up another one substantially similar called Role progression, with the following settings:

Meta data Trigger E-mail for role expiration reminders
  Class notification
  Status Enabled
  Weight 0
Conditions Operator AND. If all of these conditions are TRUE.
  Condition: Check the user's roles  
  OR: If the user has any of these roles Ticked the box for Student part 1 role, on the basis that they have this role throughout the life-cycle of the schedule.
Actions Check and invoke role progression Arguments drop-downs left with only available options — User: User and Role expiration: Role expiration.
  Send an order email regarding roles This email message is what I want to send to students when their role is upgraded every month (or 4 weeks) and the reason I don’t want to send the standard “Your role is about to expire…” message. My message is to tell them their next part is available. So far, I’ve written a generic email that just says the next part’s available, but it would be nice to be able to send messages that are customised per month, e.g. “Part 2 is now available” or “You’ve now completed your course”. However, this is definitely not a must-have now!

My problem is setting the periods after which roles progress:

  • At admin/store/settings/ucroleprog I see a list of all my roles. I open Student part 1 role and set the ‘followed by’ drop-down to Student part 2 role. This makes sense.
  • What to choose for ‘Prerequisite roles that allow this progression’ is less obvious, although I chose Student part 1 role as I guess it’s already granted as a consequence of purchasing the role from Ubercart? This may be where I’m going wrong, though it doesn’t explain the next bit.
  • Under ‘Weeks until role expires’ I choose ‘4’ but, unlike all the other settings described above, this setting is not saved — returning to this page after saving shows its gone back to ‘1’.
  • In the remaining roles listed on this page I simply say 3 follows 2, and Graduate follows 3, although this is all a bit academic while the settings aren’t apparently saved.

I think it must be me that’s missing something as, although it’s a niche module with a small user-base, nobody else seems to have come up against something so fundamental.

Thanks for reading all this and I do hope you can point me in the right direction for a solution.

Comments

mirabuck’s picture

Assigned: Unassigned » mirabuck

Hi willshaman,

I'll run some tests and see if I can replicate your issue. It'll likely be the weekend before I have a chance to do so.

Mirabuck

willshaman’s picture

Hi Mirabuck,

Thanks for the swift response. Looking forward to what you find. Let me know if you need any more info to help you out.

Best of luck,

Will

mirabuck’s picture

Category: support » bug

This is a legitimate bug. I'm surprised it hasn't come up previously now that the module's seeing a fair amount of use. Looks like the values are being saved properly in the DB, just not retrieved for use in the form when it is loaded next. I'm working on a fix.

Mirabuck

mirabuck’s picture

Assigned: mirabuck » Unassigned
Status: Active » Closed (fixed)

6.x-1.2 has been created with a fix to address this.

willshaman’s picture

Thanks Mirabuck for your prompt action and fix. I'll give it a run when I have a moment (not until next week, I'm afraid) and I'll feed back either way to let you know how I get on. Glad to have unearthed an issue. Will.

willshaman’s picture

Seems now to save settings. Now we play the waiting game to see if it actually works. Thanks! :o)

willshaman’s picture

OK. Your fix for saving the 'number of weeks' setting has definitely worked. However, now I have passed the first deadline for a role update, it failed: I had set up a role update to occur after 4 weeks, but it didn't happen. It's possible I have something wrong in my settings, so let me show you what I did and then maybe you can point out any mistakes I may have made:

As described above in my original post, I have four roles as follows:

* Student part 1 role
* Student part 2 role
* Student part 3 role
* Graduate

The first is bought immediately as an Ubercart Feature. Four weeks after purchasing, 'Student part 1 role' should expire and 'Student part 2 role' should commence. The remaining roles should then kick in at four-week intervals, so the student ascends the hierarchy in order. This is how I set up my role progression:

[1] Under admin/store/settings/ucroleprog I set 'Student part 1 role' as being followed by 'Student part 2 role', and 'Prerequisite roles that allow this progression' I set as 'Student part 1 role'. 'Weeks until role expires' I set as '4'. I am a little confused by saying this role has to have itself as a prerequisite, but I couldn't think of another answer that would make sense.

[2] I set 'Student part 2 role' as being followed by 'Student part 3 role', and 'Prerequisite roles that allow this progression' I set as 'Student part 1 role'. 'Weeks until role expires' I set as '4'. This seems logical to me.

[3] I set 'Student part 3 role' as being followed by 'Graduate', and 'Prerequisite roles that allow this progression' I set as 'Student part 2 role'. 'Weeks until role expires' I set as '4'.

When customers initially purchase 'Student part 1 role', it's set (at mysite.com/node/XXX/edit/features) as follows:

'Override the default ending expiration' (checked)
End: Relative from activation time
5 months

I'm wondering if this is confusing things? Is it perhaps that your module is overridden by my checking the default ending expiration box? The more I look at this, the more likely it seems, but I thought it worth checking with you first.

Thanks very much for your help.

Best,

Will

mirabuck’s picture

Hi Will,

Your setup in [1], [2] and [3] sounds more-or-less correct to me. In the original implementation of this module my client had several packages for sale, each with its own subset of roles--the prerequisite roles were used to ensure multiple packages would allow all of the packages to work together within a single system. They should work as expected in the setup you describe though.

You may be right about Student Part 1 role expiation confusing the situation. UC Role Expiration is typically setup to handle transitions after a role that the client initially purchases expires. Role progression typically has no bearing on the expiration of initial role as that expiration is set on the product level. If you've set your initial role to expire after 5 months then you will need to wait 5 months before it expires and role progression kicks in. Does that make sense?

Here's another question--your initial post makes it sound as if you are somewhat new to Drupal. If that's the case are you familiar with Drupal's cron system and is cron being triggered regularly on the site in question?

Many thanks,

Mirabuck

willshaman’s picture

Hi Mirabuck,

Thanks for the detailed reply and apologies for delay replying - I've been away.

My initial role should expire after 1 month (or rather, four weeks) so I think the 5 month expiry date in Ubercart must be the heart of my problem. I'll reduce the Ubercart Role 1 expiration date to match the Role Progression expiry date and see if that makes a difference. Certainly Role 1 should not be in place for 5 months - although that was my original thinking before coming across your handy module, Role Progression should take care of the permissions I want my students to have as they go through the sequence. The 5 month expiry date should therefore be redundant, I guess?

To answer your second question, I am relatively new to Drupal, having been at it for maybe 9 or 10 months. However, my starting point was as a web-savvy HTML-based designer, inexperienced with Content Management Systems, PHP, MySQL or any of that development stuff. My brother's a developer and I've watched him; I think I understand most of the basic principles, but I wouldn't call myself a developer! As for cron, I use Poormanscron to execute a cron run every hour, and this seems to work well (at least, my status report tells me cron is run hourly). I have tried using my shared host's instructions to implement a cron run at the server end, entering the appropriate numbers and stars as indicated, but it didn't appear to work. In the absence of unlimited time sorting out something that Poormanscron seems to deal with pretty effortlessly, it seemed a no-brainer to use it. Hopefully, this isn't a problem with UC Role Progression?

Thanks again for your help and even more thanks for developing such a useful module!

Best wishes,

Will

mirabuck’s picture

Hi Will,

As you've described it, reducing the expiry of role 1 to 1 month makes sense. The initial role expiry isn't exactly redundant in that its expiry triggers UC Role Progression--as you suggest, it will be through defining multiple roles in a chain with individually defined expirations (the first through UC Roles, the others through UC Role Progression) that you come to your 5 month total.

Poormanscron should work fine.

Let me know how it turns out.

Mirabuck

willshaman’s picture

Hi Mirabuck

Thanks for that. I've now passed the final point in a sequence whereby a role expiry should trigger the next (i.e. 4 weeks after the previous one). Unfortunately, this failed like the previous one did, but it may be because something in the system 'remembers' my original 5-month expiry date for this product, so perhaps this wasn't a fair test?

I wonder, in order to test this, could I set up a test role progression (with shorter expiry dates, for convenience and speed of testing) that DIDN'T begin with an Ubercart purchase? So, if I set up 'Test role 1' to expire after 1 day (I could assign it to a test subscriber using 'Add Ubercart Role' in the profile) and then created a couple of following test roles, would that be a useful method for testing? The case I've been describing has been a live customer (albeit a sympathetic one) so I couldn't really interrupt her and it seems to me it would be good to see this working straight through without a hitch.

What do you think?

Best wishes,

Will

mirabuck’s picture

Hi Will,

After going back and reading your original post I'm wondering the issue you're running into is that conditional actions haven't been configured. Could you please take a look at this post http://drupal.org/node/931426 and let me know if you're conditional actions are set up as described?

Many thanks,

Mirabuck