cron erases expiration

Posts: 70
Joined: 01/22/2008

I have a role added as a product feature. That role has an expiration date. But when CRON is run, the expiration trigger is dropped or erased, and the role assigned at purchase remains. So, in effect, once purchased, the product never expires.

I also notice that the date assigned to the role is off by several hours as viewed by the admin, but its correct as viewed by the purchaser.

Dan

Posts: 2267
Joined: 08/07/2007
AdministratoreLiTe!

I believe this was fixed in revision 918, which was after beta 6. Go check out the Bazaar repository or wait for beta 7.

For the expiration date, check that the admin and the customer have the same time zone set on their accounts. Those settings can be easy to miss.

Posts: 70
Joined: 01/22/2008

I'm using a version that is after the 918. So I don't think this particular one was fixed yet. I'll double check those time zones. Are you here at the conference? If so, I can show you how it's behaving. If not, I can let you take a look on the site with admin status if you want to see.

Dan

Posts: 2267
Joined: 08/07/2007
AdministratoreLiTe!

Nah, I'm still in Louisville.

I'd also like to see what's in the database, both before and after cron does its thing. I just need the uc_roles_expiration table, so it shouldn't be much to make some copypasta of that table. Running cron on the livetest didn't affect that table, and the expirations that are there are set to be up sometime tomorrow and Saturday.

Posts: 70
Joined: 01/22/2008

When I went to the table, there was no table because the expirations had all been removed.

I'm not sure what else to try. I showed Ryan, but he wasn't sure what could be going on there. He said that somehow we'd figured it out. Let me know if I can help in some way.

Dan

Posts: 70
Joined: 01/22/2008

Here's what I have in the database before I run cron:

UPDATE `writingdepartment_org1`.`uc_roles_expirations` SET `expiration` = '1204845900' WHERE `uc_roles_expirations`.`uid` =23 AND `uc_roles_expirations`.`rid` =3 AND `uc_roles_expirations`.`expiration` =1204845600 AND `uc_roles_expirations`.`notified` IS NULL LIMIT 1 ;

But after I run cron, there's nothing in this part of the database.

Dan

Posts: 2267
Joined: 08/07/2007
AdministratoreLiTe!

With the code I have, it doesn't look like this should happen. But maybe things are just funky. In the users_roles table, does user 23 have role 3, both before and after the cron run? Also, set the module to send emails when it revokes permission because they expire. I'd like to see whether it thinks the expiration date is past, or the user never had the role in the first place.

Posts: 70
Joined: 01/22/2008

I wonder if I should apologize here for this bug report because I think this may just be a simple case of time stamp problems. I'm the admin, I'm creating accounts for fictional users, the users and I had different time zones, and then, to top it off, I was pasting in Epoch Unix times that were five hours expired because I wasn't paying attention to the GMT. So I was pasting in "expired" time stamps (five hours old). So then, I ran cron and it erased the role as it should have since it expired five hours ago!

Couple this confusion with the fact that up through the DrupalCon I may have been using a slightly older dev version of Ubercart that had not fixed some of this problem and the total effect was confusion and what appeared to be a bug.

At any rate, I do feel it's working properly, and I'm sorry for the effort you put in on my part here. But thanks for not blowing it off even when it worked for you.

Does that make sense?

Dan

Posts: 332
Joined: 08/07/2007
Administrator

I was going to say that discrepancy between dates on the expirations page might be the result of your date & time settings (admin/settings/date-time), but it seems you caught that; the uc_roles module makes use of format_date to display the timezone adjusted date to users. Also, there was previous revisions that had issue with incorrect date math. I hope everything is working out ok now.

--

-Shawn Conn: If the Name Don't Rhyme It Ain't Mine

Posts: 70
Joined: 01/22/2008

Yes, thanks. It seems to be working fine now.

I am having trouble with attributes and options, but I've entered that problem in a bug report and TR has followed up with me some--but still not fixed.

Dan

Posts: 5367
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Rock on, Dan! I'm so glad to hear you got this one all figured out. It was great to meet you in Boston. Smiling

Posts: 70
Joined: 01/22/2008

Yes, it was just a great conference, Ryan. I was so impressed with all of the vision and imagination I saw on display there. Your presentation was terrific!

Dan