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:

mysite.com/vanilla/discussions/

when the regular discussions page exists at:

mysite.com/forums/discussions/

Does anyone know where to change this one incorrect variable?

Thanks!

Comments

  • 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.

    Replace:
          // 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');
    $this->Render();
    with:
          // 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);
    $this->Render();
    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:

    http://camstudio.org/forum/categories/categories/moderators-only

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

    Cheers

    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
    @yu_tang

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

    Cheers

    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 2.0.17.10, embedded in an iframe; replacing with "/forum/discussions" didn't work. I had to replace (three instances of)

    "/vanilla/discussions"

    with

    "/forum/index.php?p=/discussions"

    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
  • @EugenioR 's solution should work, and this issue has been fixed in the latest 2.0.18 beta.
Sign In or Register to comment.