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.

Deleting a discussion ends in a 404

edited March 2011 in Vanilla 2.0 - 2.8
Hi there

My vanilla forum appears to be working perfectly, except for one strange glitch - when I delete a discussion, the discussion disappears (as expected) but then the page redirects to what looks like it should be the discussions list, but the URL is wrong so the page 404s.

the URL used is:

when the regular discussions page exists at:

Does anyone know where to change this one incorrect variable?



  • Yep, I'm having the same problem as well.

    Anyone shed any light on this?
  • I just had it as well.
  • lucluc ✭✭
    Deleting it from the discussion from the list of discussions or within one?

    I think I saw some fixes for that go into the unstable branch.
  • /applications/vanilla/controllers/class.discussioncontroller.php

    Search Delete() function.

          // Redirect
    if ($this->_DeliveryType === DELIVERY_TYPE_ALL)
    Redirect(GetIncomingValue('Target', '/vanilla/discussions'));

    if ($this->Form->ErrorCount() > 0)
    $this->SetJson('ErrorMessage', $this->Form->Errors());

    $this->RedirectUrl = GetIncomingValue('Target', '/vanilla/discussions');
          // Redirect
    $DefaultController = Gdn::Router()->GetRoute('DefaultController');
    $DefaultTarget = Gdn_Url::WebRoot(TRUE).'/'.$DefaultController['Destination'];

    if ($this->_DeliveryType === DELIVERY_TYPE_ALL)
    Redirect(GetIncomingValue('Target', $DefaultTarget));

    if ($this->Form->ErrorCount() > 0)
    $this->SetJson('ErrorMessage', $this->Form->Errors());

    $this->RedirectUrl = GetIncomingValue('Target', $DefaultTarget);
    I don't like a core hack and an upgrading nightmare.
    Hope fix coming in next release.
    I think I saw some fixes for that go into the unstable branch.
    Can you please point me out in which commit of the unstable branch?
    Try to find and seems to be lost.
    Thanks in advance.
  • lucluc ✭✭
    @yu_tang: I guess I imagined it, or I saw some fix in the forum instead of the rss feed of the commits.
    I had a look at all the commits comments up to end of January and nothing seemed to be fixing this.
  • @luc
    Oh, I got it. Thanks for your time. :-)
  • camstudiocamstudio
    edited April 2011
    @yu_tang I tried your fix and got redirected to this URL:

    There's one "categories" too many ...


    Nick :o)
  • @camstudio
    Thanks for your feedback.
    You can simply replace '/vanilla/discussions' with your url.
    It's just a temporary solution, but I think it is enough for now unless you change vanilla directory everyday.
  • @yu_tang thank you
  • camstudiocamstudio
    edited June 2011

    Sorry, only just got back to this topic ... do you mean in the original code I should just replace '/vanilla/discussions' with '/forum/discussions' ??


    Nick :o)
  • @camstudio
    Yes, you got it.

    Btw, have you tested this issue with 2.0.18?
  • edited October 2011
    I had the same problem. Version, embedded in an iframe; replacing with "/forum/discussions" didn't work. I had to replace (three instances of)




    Maybe this can help someone else, maybe I'm pointing an obvious thing... btw, this fixed the problem. Thanks.
  • edited October 2011
    My solution, I created an index.php *, in vanilla / discussions (/index.php *), and a rerouting towards the page of home

    It allows not to touch the code of origin
  • jspautschjspautsch Themester ✭✭✭
    @EugenioR 's solution should work, and this issue has been fixed in the latest 2.0.18 beta.
Sign In or Register to comment.