Closed (outdated)
Project:
Views random seed
Version:
6.x-1.4
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
24 Sep 2011 at 14:53 UTC
Updated:
6 Jul 2021 at 12:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
swentel commentedIt looks like you found a nice bug here. If the seed for the user is the same, the reset option shouldn't rely on the time stored in the user's session. In that case we should have a timestamp in the variables for this view as well. Because now, it's possible that the seed changes depending on the visitors of a site if they already have a session or not, for instance.
- user a visits for the first time. A variable is set and the time of is recorded in the session of this user
- user b visits 12 hours later, uses the same variable and his visit time is recorded as well
- user a comes back after 24 hours, resets the variable and the time in his session
- user b comes back after 24 hours (after his first visit), resets the variable as well although it should at least last 12 hours longer
- now if user a comes back 5 minutes after user b, he will have a different seed now because user b has reset it
Attached a patch, completely untested though, could you see if this fixes the problem ?
Comment #2
mikemccaffreyLooks like there is a parse error in that patch.
This line:
$seed_time = $options['user_seed_type'] == 'diff_per_user' ? $_SESSION[$seed_time] ? variable_get($seed_time, $time);Should probably be:
$seed_time = $options['user_seed_type'] == 'diff_per_user' ? $_SESSION[$seed_time] : variable_get($seed_time, $time);Comment #3
swentel commentedDrupal 6 is not supported anymore.
Also, this is in D7 and D8