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.

[Vanilla Core 2.0.17.x] [Bug 582] [Quick-Fix]Post Deletion Redirects Incorrectly

edited February 2011 in Vanilla 2.0 - 2.8
@Tim @Todd @digibomb When an admin deletes a post they are re-directed to to http://hostname.com/vanilla/discussions . The problem comes in that I have vanilla installed to /forums not /vanilla, so it redirects incorrectly. Is this a hard-coded value and if so, shouldn't it be relegated to a database or a variable that's set upon install?

I'm running 2.0.17.3 on CentOS with all the system requirements met.

Comments

  • I've filed a bug on GitHub, but it looks to be a duplicate of this bug: https://github.com/vanillaforums/Garden/issuesearch?state=open&q=delete#issue/582
  • If you're having this issue as a quick fix (until there's an official fix) do this:

    go to applications/vanilla/controllers/class.discussioncontroller.php

    Modify lines 537, 542 and 588 where it says '/vanilla/discussions' to match whatever you have for your sites base install. In my case I have installed in a folder named 'forums' underneath my main url (eg. http://yourhostname.com/forums/) so I replaced vanilla with forums and it works now.
  • Thanks for posting the patch for this!
  • @Pixelnated No problem. I figured I wasn't the only person with this issue. As a note on github they replied with this:

    "I bet you installed the forum and then renamed the folder. There is a "webroot" configuration setting in conf/config.php. Look for this:

    $Configuration['Garden']['WebRoot'] = 'vanilla';

    and replace it with this:

    $Configuration['Garden']['WebRoot'] = 'forums';
    "

    I installed it to the same directory that I had it in originally so it wasn't this. However, it is worth noting it, fwiw.
  • Hi guys, I've added the bug number and Vanilla version in the title for future reference

    There was an error rendering this rich post.

  • Ok thanks!
  • UnderDogUnderDog MVP
    edited February 2011
    So... I can reproduce this bug in a clean install of Vanilla 2.0.17.8 (in a special directory, not called "vanilla"). With my install it redirects to /categories/categories/general but it keeps that special directory. It's still a problem, but it might have something to do with the settings you guys have in the "homepage" section of your dashboard.
    I'll check the other settings to make sure.

    edit
    IMHO It depends on from where you delete the discussion. You can delete the discussion
    • when you see all the discussion in a category (url = categories/general)
    • when you're inside the discussion (url = discussion/7/test3#Item_1)
    When you're inside the discussion you get redirected to the hardcoded value (so we need @ArrantSquid solution)
    When you're viewing all discussions and you have your homepage set to "All Discussions" or "All Categories", you'll get redirected to categories/categories/general

    If you have set your homepage to "Categories And Discussions" you will get redirected properly
    Same goes for when you've set your homepage to "Activity"

    I've updated the bug report https://github.com/vanillaforums/Garden/issues/#issue/582

    There was an error rendering this rich post.

  • UnderDogUnderDog MVP
    edited February 2011
    @solevangelist @ramyhin please follow this thread, it's all about the same issue : bug 582
    @Mark @Tim
    Two more threads with the same problem:
    http://www.vanillaforums.org/discussion/14645/bug-582-redirected-to-wrong-location-when-discussion-deleted/p1
    and
    http://www.vanillaforums.org/discussion/14758/redirect-to-domain.comsubdirdiscussions-when-deleting-a-post-on-domain.com/p1
    although now a 500 internal error was also reported in 1 of the threads, it's all about the same issue : bug 582

    There was an error rendering this rich post.

  • after following the instruction on
    http://www.vanilla-wiki.info/Bugs/SmallBugs
    i still had a small bug where at deleting a discussion i would be sent to
    http://vanillaforum.mysite.com//categories/all
    (i have vanilla on a sub domain)
    so i changed
    $DefaultTarget = Gdn_Url::WebRoot(TRUE).'/'.$DefaultController['Destination'];
    to
    $DefaultTarget = Gdn_Url::WebRoot(TRUE).'index.php?p=/'.$DefaultController['Destination'];

    hope this helps someone
Sign In or Register to comment.