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.
Incorrect redirect after clearing Private Messages (Conversations)
I have Vanilla 2.0.16 installed to directory http://mysite.com/forum/
When I delete (clear) conversations (I am pressing button Delete Conversation). Dialog box pops up and I press OK. Then It redirects me to http://mysite.com/forum/forum/messages/all instead of http://mysite.com/forum/messages/all. So I get 404 error after deleting conversation, because it redirects me to /forum/forum/... instead of /forum/...
How to solve this? Is it bug or not?
When I delete (clear) conversations (I am pressing button Delete Conversation). Dialog box pops up and I press OK. Then It redirects me to http://mysite.com/forum/forum/messages/all instead of http://mysite.com/forum/messages/all. So I get 404 error after deleting conversation, because it redirects me to /forum/forum/... instead of /forum/...
How to solve this? Is it bug or not?
Tagged:
0
Comments
In class.messagecontroller.php if function Clear() line:
$this->RedirectUrl = Url('/messages/all');
change to:
$this->RedirectUrl = Gdn::Request()->Url('messages/all', TRUE);
Vanilla Forums COO [GitHub, Twitter, About.me]
https://github.com/vanillaforums/Garden/issuesearch?state=open&q=deleting#issue/582
I'm running Vanilla in a folder /foo When deleting a private message (conversation) I get redirected to /foo/foo/messages/all - the folder gets doubled up. When looking at what "Url(...)" gives, it includes the /foo and I gess the AJAX handler adds the http://domain/foo prefix to that too.
The above suggested fix works for me. I guess it gets around the problem by passing the AJAX handler a full (external) URL to the messages page, complete with domain, and that stops the JS AJAX handler from adding its own path on.
Thanks for the extra info, @judgej. I'm reticent to just throw the 'TRUE' on the end to send it with domain rather than fixing whatever the core problem might be with the ajax handler.
TBH, full URLs everywhere they are used dynamically are a fine way to approach this kind of issue in my experience. It is only when URLs (and root paths) get embedded in logfiles and content that it becomes a problem, since it makes the application much less portable.
It not as though people constantly move their applications around, but to support staging areas and pre-production/test instances, it needs to be easily relocatable to new paths and domains, with a full copy of live data.
I tried your method above... but could only get it to work by changing it to:
`public function Clear($ConversationID = FALSE) {
$Session = Gdn::Session();