Loriowar / redmine_issues_tree

Provides a tree view of the Redmine issues list
GNU General Public License v3.0
115 stars 72 forks source link

Redirect URL mismatch #5

Closed MarkZackie closed 8 years ago

MarkZackie commented 9 years ago

I have Redmine 3.1 with Thin and Nginx server.

The "Tree View" link is correct: http://mydomain:port/projects/myproject/issues#

But when I click it, after a POST, i get a wrong redirect to this url: http://redmine/projects/myproject/issues_trees/tree_index?.....

Note: all Redmine redirects (login, logout etc.) are ok in my installation.

Loriowar commented 9 years ago

Why you think what this is wrong url? You received a 404 or 500 http response code? Or there is no a tree of issues on a redirected page? This is a standard plugin behaviour. After push on "Tree view" button you receive redirect to a custom plugin page instead of default Redmine template with a plain issues list.

Loriowar commented 9 years ago

Oh, sorry, I think understand your problem. Redirect construct wrong url in domain and port parts? You told about skipping port in url?

wangshengshun commented 9 years ago

My question is: because we project tasks need to be resolved, and we are now using a 2.5, but I see what you write is version 2.6, I think you can be compatible with the plug-in version 2.5, and is looking forward to you can be backward compatible with (2.5,2.3 ...), thank you!

MarkZackie commented 9 years ago

Oh, sorry, I think understand your problem. Redirect construct wrong url in domain and port parts? You told about skipping port in url?

Exactly, Loriowar. The redirect misses domain and port (http://mydomain:port/...), so the browser tries to resolve "redmine" host (http://redmine/...).

Loriowar commented 9 years ago

Hmm, strange behaviour. Thanks for the bug. I will try to repeat this locally and fix if possible.

MarkZackie commented 9 years ago

Some logs that might be useful...

Clicking to "Tree view" link:

http://mydomain:port/projects/myproject/issues#

Nginx

"POST /projects/myproject/issues_trees/redirect_with_params HTTP/1.1" 200 392 "http://mydomain:port/projects/myproject/issues" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.93 Safari/537.36"

Ruby

Started POST "/projects/myproject/issues_trees/redirect_with_params" for 127.0.0.1 at 2015-09-18 13:43:13 +0200 Processing by IssuesTreesController#redirect_with_params as JSON Parameters: {"utf8"=>"â", "set_filter"=>"1", "f"=>["due_date", ""], "op"=>{"due_date"=>"*"}, "c"=>["project", "tracker", "category", "status", "priority", "subject", "author", "assigned_to", "updated_on"], "group_by"=>"", "project_id"=>"myproject"} Current user: admin (id=1) Completed 200 OK in 14ms (Views: 0.9ms | ActiveRecord: 0.7ms)

Response sent back to browser:

{"redirect":"http://redmine/projects/myproject/issues_trees/tree_index?c%5B%5D=project\u0026c%5B%5D=tracker\u0026c%5B%5D=category\u0026c%5B%5D=status\u0026c%5B%5D=priority\u0026c%5B%5D=subject\u0026c%5B%5D=author\u0026c%5B%5D=assigned_to\u0026c%5B%5D=updated_on\u0026f%5B%5D=due_date\u0026f%5B%5D=\u0026group_by=\u0026op%5Bdue_date%5D=%2A\u0026project_id=myproject\u0026set_filter=1"}

Loriowar commented 8 years ago

Hey! Hope I fixed your problem. Please, click on "Tree view" link within last version of plugin from master branch.