HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Bug report: deleting user/blanking content

Hi,

I just tried to delete an old test user while blanking content, and got the following error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'c from GDN_Comment c join GDN_Discussion d on c.DiscussionID = d.DiscussionID wh' at line 1|Gdn_Database|Query|delete GDN_Comment c from GDN_Comment c join GDN_Discussion d on c.DiscussionID = d.DiscussionID where d.InsertUserID = :dInsertUserID

Looks like there's an errant "c" in there for the field name to be deleted from the table.

Cheers,
Dave.

Comments

  • not a bad idea to report the version of vanilla where it occurs.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • DenisSDenisS My brain hurts Buriram ✭✭
    edited August 2013

    I get the same on Delete user & Blank User Content vanilla ver 2.0.18.4

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'c from GDN_Comment c join GDN_Discussion d on c.DiscussionID = d.DiscussionID wh' at line 1|Gdn_Database|Query|delete GDN_Comment c from GDN_Comment c join GDN_Discussion d on c.DiscussionID = d.DiscussionID where d.InsertUserID = :dInsertUserID
    
  • edited November 2013

    Any solution for this? vanilla 2.0.18.8

  • hgtonighthgtonight ∞ · New Moderator

    This is fixed in the beta. Patch below:

    --- /vanilla-core-2-0-18-8/applications/vanilla/settings/class.hooks.php
    +++ /vanilla20/applications/vanilla/settings/class.hooks.php
    @@ -92,11 +92,6 @@
                 ->Set('Format', 'Deleted')
                 ->Where('InsertUserID', $UserID)
                 ->Put();
    -         
    -         // Erase the user's comments
    -           $Sender->SQL->From('Comment')
    -               ->Join('Discussion d', 'c.DiscussionID = d.DiscussionID')
    -               ->Delete('Comment c', array('d.InsertUserID' => $UserID));
    
              $Sender->SQL->Update('Comment')
                 ->Set('Body', T('The user and all related content has been deleted.'))
    

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

Sign In or Register to comment.