Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access Cap Times, Double level0 Entries? #237

Closed
jaswrks opened this issue Jul 10, 2014 · 8 comments
Closed

Access Cap Times, Double level0 Entries? #237

jaswrks opened this issue Jul 10, 2014 · 8 comments

Comments

@jaswrks
Copy link
Contributor

jaswrks commented Jul 10, 2014

A fork of #223 (comment)

@clavaque writes...

The access caps times log for that user (ID 20) has an entry older for level0 than the other caps, as if the account had been registered before the signup.

Array
(
[1375373865.0001] => level0
[1404804243.0001] => level0
[1404804243.0002] => level1
[1404804243.0003] => level2
)

Actually I had done a Level 1 test signup before that one (user ID 19), so I checked its times and the exact same time is there for level0 at the beginning.

Array
(
[1375373865.0001] => level0
[1404803609.0001] => level0
[1404803609.0002] => level1
)
@jaswrks jaswrks added this to the Next Release milestone Jul 10, 2014
@jaswrks jaswrks added the todo label Jul 10, 2014
@jaswrks jaswrks modified the milestones: Future Release, Next Release Jul 10, 2014
@jaswrks
Copy link
Contributor Author

jaswrks commented Jul 10, 2014

I suspect what is causing this, is actually a bug in the WP core related to the user object cache. I am punting this to a "Future Release". We will need time to investigate it further and try to identify the cause. For now, it seems harmless enough.

@jaswrks jaswrks self-assigned this Jul 27, 2014
@jaswrks
Copy link
Contributor Author

jaswrks commented Jul 27, 2014

Moving this to the "Next Release" milestone and assigning this to myself.

@jaswrks
Copy link
Contributor Author

jaswrks commented Aug 7, 2014

@clavaque Do you have any leads on how/why this is occurring? I'm looking now but so far I'm just not seeing how this is actually happening, or why.

@jaswrks
Copy link
Contributor Author

jaswrks commented Aug 7, 2014

I see this is NOT actually a bug, it is the intended behavior.

The first level0 comes from this line of code.

@clavaque Can you confirm this is not a bug for me please? See this line in the source code where we pull together the registration time and that is included also when it is less then the minimum. That makes sense to me, because the registration time is almost always less than the time at which a customer is actually bumped to a higher level.

@jaswrks jaswrks added the wontfix label Aug 7, 2014
@clavaque
Copy link
Contributor

clavaque commented Aug 7, 2014

Yes, that logic is fine. The problem is that different users, registered at different times, have the same time for level 0...

I have a hunch the problem may be related to this line: https://github.com/websharks/s2member/blob/000000-dev/s2member/includes/classes/registration-times.inc.php#L74

It's possible that I was logged in as the admin when I created those accounts, either from the dashboard or wp-login.

What do you think?

@jaswrks
Copy link
Contributor Author

jaswrks commented Aug 7, 2014

Ah, good catch! We should be passing the $user_id when we call upon registration_time().

@jaswrks
Copy link
Contributor Author

jaswrks commented Aug 7, 2014

This has been resolved now.

@jaswrks jaswrks closed this as completed Aug 7, 2014
@clavaque
Copy link
Contributor

clavaque commented Aug 7, 2014

Excellent! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants