Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

[gitHub #1570] Problem deleting discussions

StumpyJoeStumpyJoe
edited April 2013 in Vanilla 2.0 - 2.8

New install of 2.0.18.4 with a phpBB 3 import.

First I tried deleting entire categories, but I couldn't. Found out this was a mySql error with the current version, so that's ok, I'll roll all those discussions into a "Trash" category, and delete them all there.

I enabled the Split/Merge plugin which I think(?) added the checkboxes next to each discussion. When I click the checkbox I get the "You have selected 1 discussion" popup on the lower left where I can delete, merge or cancel. If I click "delete" down there I get a popup that says "Permission Problem. You don't have permission do to that". But I DO. I'm the admin, and I've doublechecked all the permissions.

If I unclick that checkbox, then click it again, I can choose "delete" from the "Option" drop down list, and if I delete that way, I'll get one of two results: 1) The discussion is deleted. and/or 2) I get a blank page that says nothing but "TRUE"

This is just trying to delete SINGLE discussions. If I try checking multiple checkboxes I get the same permission problem mentioned above if I try using the popup in the lower left (also, it incorrectly keeps track of the number of discussions I've actually marked). If I check multiple discussions and try deleting them via the "Option" drop-down the website will hang and do nothing, or it'll only delete one discussion.

Long story short: How do I delete multiple discussions without a hassle? And any idea what's causing these problems? Thanks.

Comments

  • hgtonighthgtonight ∞ · New Moderator

    The easiest way to mass delete in 2.0.18.4 is to move them all to a certain category and then hacking them out of the db.

    I ran in to this same issue and just created an "Archive" category that no one can see. This was beneficial to my community, not sure about your situation.

    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.

  • The easiest way to mass delete is to multi-select the discussions and then delete them. If you run into either problems or bugs, you deal with the bugs and not work around it.

    There was an error rendering this rich post.

  • Well...that's what I asked. How do I deal with this bug? (The bug being described in the original post...can't delete using the popup in the lower left, but can if I use the options drop-down. Also the popup in the lower left doesn't correctly keep track of the discussion I have checked/unchecked.) Thanks.

  • I think the multi-delete (and possibly the single delete) in split merge might be broken, or when testing I had the same problem as original poster. but then again I don't use the plugin.

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

  • motahcitymotahcity
    edited March 2013

    Here's a problem that I have. I cannot delete multiple posts. I have to do them one at a time and it's a pain. When I check several posts and try to delete them I get this message:

    Permission Problem

    You don't have permission to do that.
    Authorization Required

    This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.

    Since I am the administrator I have set all permissions for my user account. What more do I need to do so that I can delete multiple posts in the same discussion?

  • report it on github.

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

  • there are two
    Split/Merge plugins.

    which plugin. Looking at the way the plugins are written i don't see how you can delete multiple discussions.

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

  • @motahcity said:
    Here's a problem that I have. I cannot delete multiple posts. I have to do them one at a time and it's a pain. When I check several posts and try to delete them I get this message:

    Permission Problem

    You don't have permission to do that.
    Authorization Required

    Show a screenshot please, because it doesn't look like it's a vanilla text, but something else (apache error, anything), screenshot will help.
    @StumpyJoe also show screenshot please

    There was an error rendering this rich post.

  • peregrineperegrine MVP
    edited March 2013

    Here's the trick.

    The split/merge plugin really only allows split/merge of discussions, but there is a popup that includes a link to delete also from the moderation controller on the discussion topic (list of discussions page). Within the discussions you will see split/merge.

    The way to delete the messages is to login as the "root" id user 0 and the multiple delete will work., since as far as i can tell the permission checking doesn't seem to work the other way, even if you are an admin (not 0) with all permissions checked for that role.


    there is a bug in the core applications/vanilla/controllers/class.moderationcontroller.php

     public function ConfirmDiscussionDeletes() {
          $Session = Gdn::Session();
          $this->Form = new Gdn_Form();
          $DiscussionModel = new DiscussionModel();
          
          // Verify that the user has permission to perform the deletes
       // ****************  BUG LINE BELOW   
        $this->Permission('Vanilla.Comment.Delete', TRUE, 'Category', 'any');
    
    
    
    line 291 should be
    
     $this->Permission('Vanilla.Comments.Delete', TRUE, 'Category', 'any');
    
    or better yet
    $this->Permission('Vanilla.Discussions.Delete', TRUE, 'Category', 'any');
    
    

    there is no such permission Vanilla.Comment.Delete

    Comment should be Comments

    I'm too tire to file a bug on github but you can..

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

  • If I wasn't such a noob (github?) I'd file that bug, because it seems I'm not the only one with this problem. But thanks for nailing it.

    Is it safe to change that file/line on my server or is it best to wait for an update?

  • peregrineperegrine MVP
    edited March 2013

    Is it safe to change that file/line on my server or is it best to wait for an update?

    You might be waiting for a long time for an update. Safe? I believe so.

    Login with user id 0, if you don't want to change it.

    It's your decision.

    If I wasn't such a noob (github?) I'd file that bug,

    create a user name, login to github, and reference the discussion. no excuse for being a noob, only for being lazy (which I am).

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

  • @peregrine thanks again for finding that line in the code. When I tried modifying it before it didn't work, but then when I installed the Split/Merge (FE) plugin and modified that line it deletes multiple discussions a-ok.

    Last question about this: When I confirm that I want to delete X amount of discussions, it loads website.com/discussions/ instead of website.net/forum or even just staying in the category I was in. Where can I change this? Is it a route I have to create? on js\route.js I see:
    // Pop add/edit route clicks and reload the page contents when finished. $('a.AddRoute, a.EditRoute').popup({ onUnload: function(settings) { $('#Content').load(gdn.url('/dashboard/routes?DeliveryType=VIEW')); } });
    Do I need to create a new route called DeliveryType? Or...?

    Basically I'd like it to stay on the same page I was one when I deleted the discussions, but going back to /forum would be ok too.

Sign In or Register to comment.