Not signed in (Sign In)
 
Aug 17th 2008 edited
 
I was ploughing through code and data when I came upon an oddity in the whisper tracking tables. The lum_DiscussionUserWhisperTo contains columns WhisperToUserID, keeping track of whispers recieved by a user in a discussion, and LastUserID, the last user to send such a whisper. In this the data is normal, and can be confirmed by the code:$s->AddFieldNameValue('WhisperToUserID', $Comment->WhisperUserID);
$s->AddFieldNameValue('LastUserID', $this->Context->Session->UserID);
However, here is where we find what looks like a bug. The lum_DiscussionUserWhisperFrom table has similar columns -- WhisperFromUserID and LastUserID -- performing much the same function as the other table's, but in reverse: the former records whispers sent from a user in a discussion, and the latter /should/ track the last user to recieve one of these. However, the code for that section does not follow this goal:$s->AddFieldNameValue('WhisperFromUserID', $this->Context->Session->UserID);
$s->AddFieldNameValue('LastUserID', $this->Context->Session->UserID);
It looks suspiciously like mark forgot to change a paramater while saving himself some coding...

oh yeah this is in CommentManager::SaveComment, btw
 
Aug 17th 2008 edited
 
/me needs sleep
 
Aug 18th 2008
 
Welcome to what is probably the most confusing function in Vanilla. I've written and rewritten this function more times than I care to count. Have you seen the bug rear it's head somewhere? Can you cause the bug to happen?
 
Aug 18th 2008
 
well that's on of the weird things; you don't ever seem to actually use the values in the LastUserID columns. There's one small moment in which you use it as a boolean test in ordering discussions, but aside from that it looks like it dosn't really matter what values you put in there. The oddity struck me while I was fixing bugs/updating the comment removal addon, and examining the sql data of those tables. It's more of a 'theoretical bug' I suppose.

Issue information

  • 76
  • No assigned user

    No assigned user

     

  • Open
  • Low
  • Bug

Vanilla 1.1.5 is a product of Lussumo. More Information: Documentation, Community Support.