I was quickly looking for the link to BBCM today, and figured I'd click on my member card and the "Resources" count to find it... But count doesn't show on your own member card?
Looked into it just to see if it was a weird check ({$user.resource_count} > 1 or something), but it just checks for the existence of the variable (so mine should be 1) and hence, for a truthy value, which 1 is. I'm stumped... I'll try to break it tonight.
I figured. Still gonna try to break it when I'm at home to see if I know the issue. (the following is a moment of pure "aha" thought process... ignore the randomness) Actually, I may know the underlying issue! I'd have to test it some, but I know BBCM was deleted at one point for a reported security flaw, and restored. Possibly caused by this block of code in XenResource_DataWriter_Resource::_resourceMadeVisible:
PHP:
if ($this->get('user_id') && $this->get('resource_state') == 'visible')
{
$this->_db->query('
UPDATE xf_user
SET resource_count = resource_count + 1
WHERE user_id = ?
', $this->get('user_id'));
}
Without a proper test instance (I'm at work), I can't verify this. Shouldn't $this->get('user_id') be $this->getExisting('user_id') since the resource was previously available and in existence?
Actually the issue may well have been the undelete, as we did do an undelete once from the DB directly (before the RM had that function), which would've triggered this.
Actually the issue may well have been the undelete, as we did do an undelete once from the DB directly (before the RM had that function), which would've triggered this.
I love when my "Aha!" moments have some kind of real basis to them... Now if only I had the desire to apply that to my work projects right now (but having the RM code up actually makes it look like I'm doing something... ).