Bug #622

Reputation by a deleted user

Added by Stefan T. about 2 years ago. Updated about 2 years ago.

Status:Closed Start date:12/31/2009
Priority:Normal Due date:
Assignee:Tom Moore % Done:

100%

Category:Reputation system
Target version:1.4.12
Reproducibility:Always Database Type:
Reported In MyBB Version:1.4.10 Database Version:
PHP Version: SQA assignments:
Browser:

Description

When a user rated you and this user was deleted later, the entry on the reputation page looks like this: Guest ()

Associated revisions

Revision 4694
Added by Tom Moore about 2 years ago

Fixes Reputation by a deleted user (fixes:622)

Revision 4697
Added by Tom Moore about 2 years ago

Improves Reputation by a deleted user (improves:622)

Revision 4699
Added by Tom Moore about 2 years ago

Fixes Reputation by a deleted user (fixes:622)

History

Updated by Tom Moore about 2 years ago

At the moment, the reputation table doesn't hold the username of the person giving the comment. It would be possible (perhaps as part of #214 and 1.6) to add it in?

Updated by Stefan T. about 2 years ago

Perhaps you can remove the ()?

Updated by Ryan Gordon about 2 years ago

Just replace it with N/A or remove the users reputations when the user gets deleted (imo the later should happen, and the first one be implemented just in case)

Updated by Huji Lee about 2 years ago

Why isn't this enough:

Index: trunk/admin/modules/user/users.php ===================================================================
--- trunk/admin/modules/user/users.php (revision 4690)
++ trunk/admin/modules/user/users.php (working copy)
@ -1600,6 +1600,7 @
$db->delete_query("users", "uid='{$user['uid']}'");
$db->delete_query("joinrequests", "uid='{$user['uid']}'");
$db->delete_query("warnings", "uid='{$user['uid']}'");
$db->delete_query("reputation", "uid='{$user['uid']}'");

// Update forum stats
update_stats(array('numusers' => '-1'));

Updated by Huji Lee about 2 years ago

Sorry:

Index: trunk/admin/modules/user/users.php
===================================================================
--- trunk/admin/modules/user/users.php    (revision 4690)
+++ trunk/admin/modules/user/users.php    (working copy)
@@ -1600,6 +1600,7 @@
         $db->delete_query("users", "uid='{$user['uid']}'");
         $db->delete_query("joinrequests", "uid='{$user['uid']}'");
         $db->delete_query("warnings", "uid='{$user['uid']}'");
+        $db->delete_query("reputation", "uid='{$user['uid']}'");

         // Update forum stats
         update_stats(array('numusers' => '-1'));

Updated by Stefan T. about 2 years ago

That's an other bug... :P I talked about reputations given by deleted users.

Updated by Tom Moore about 2 years ago

  • Status changed from New to Assigned
  • Assignee set to Tom Moore
  • Target version set to 1.4.12

Updated by Tom Moore about 2 years ago

  • Status changed from Assigned to Resolved
  • % Done changed from 0 to 100

Applied in changeset r4694.

Updated by Stefan T. about 2 years ago

  • Status changed from Resolved to Feedback

Why don't you just remove the reputations? I don't understand why you remove them user by user.

There is a related bug:

                    if($reputation_vote['username'])
                    {
                            $reputation_vote['user_reputation'] = " <span class=\"smalltext\">({$reputation_vote['user_reputation']})";
                    }
                    else
                    {
                            $reputation_vote['user_reputation'] = '';
                    }

Only when there is a username the span is opened but it is closed in a template in both cases.

Updated by Tom Moore about 2 years ago

I forgot to remove that; I was trying to find an easy way to sync a user's reputation once the deleted user's reputation was removed.

Updated by Tom Moore about 2 years ago

  • Status changed from Feedback to Resolved

r4697 resolves those issues (forgot improves doesn't do that)...

Updated by Stefan T. about 2 years ago

  • Status changed from Resolved to Feedback

Ok, I noticed that this is stupid, because $reputation_vote['username'] is set about 40 lines above:

        if($reputation_vote['username'])
        {
            $reputation_vote['user_reputation'] = "({$reputation_vote['user_reputation']})";
        }
        else
        {
            $reputation_vote['user_reputation'] = '';
        }

Updated by Tom Moore about 2 years ago

  • Status changed from Feedback to Resolved

Applied in changeset r4699.

Updated by Stefan T. about 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF