Expiration display on user profile not obeying setting
| Project: | Ubercart |
| Version: | 6.x-2.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | active |
I'm using uc role assignment, and after setting "Show expirations on user page" to TRUE on product features setting page and then setting it to FALSE (i.e., unchecking the box), the role expirations are still showing up on the user profile page. I checked the database and it looks like the variable is being recorded to the variable table correctly, so then I checked the code and discovered what I believe is a conditional logic error. Around line 448 is this code:
if (!user_access('view all role expirations') && ($user->uid != $account->uid || !$show_expiration)) {
This seems to be making it so the role expirations show up on the user profile page regardless of what the setting is. To correct it, I just added an extra condition after this line of:
if ($show_expiration) {
And that fixed it. That may not be the best solution, though, and the logic could probably just be incorporated into the first conditional statement.
