Project

General

Profile

Actions

Defect #18058

closed

Wrong redirect after saving changes to a version (Firefox with network.http.referer.trimmingPolicy = 2)

Added by Anonymous about 10 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Normal
Category:
Roadmap
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

Steps to reproduce:
  • Go to a roadmap page
  • Click on a version number
  • Click on edit (URL ex: /versions/65/edit)
  • Click on Save
    You'll be redirect to the main page. I'd expect to be redirected back to the roadmap page.

The same applies to editing versions via Project Page > Settings > Versions tab.

My Configuration:

Environment:
  Redmine version                2.5.1.stable
  Ruby version                   1.8.7-p352 (2011-06-30) [x86_64-linux]
  Rails version                  3.2.17
  Environment                    production
  Database adapter               Mysql2
SCM:
  Subversion                     1.6.11
  Git                            1.7.1
  Filesystem
Redmine plugins:
  no plugin installed

Actions #1

Updated by Anonymous about 10 years ago

The same wrong redirect happens when following these steps on a roadmap page:
  • Click on a version label (linked to a URL like /version/65)
  • In the shown list of issues, right click one of these to open the context menu.
  • Change the issue status via the context menu.

=> You'll be redirected to the main page instead of back to the roadmap page.

Actions #2

Updated by Anonymous about 10 years ago

In the context menu, the link to change the status looks like

/issues/bulk_update?back_url=https%3A%2F%2Fredmine.example.com&ids%5B%5D=342&issue%5Bstatus_id%5D=3

Actions #3

Updated by Jean-Philippe Lang about 10 years ago

  • Resolution set to Cant reproduce

Works for me, I'm redirected to the previous page, not the main page.

Here is the link that I get to update an issue from a version page:
/issues/bulk_update?back_url=http%3A%2F%2Flocalhost%3A3000%2Fversions%2F1&ids%5B%5D=753&issue%5Bstatus_id%5D=1

Actions #4

Updated by Anonymous about 10 years ago

Jean-Philippe Lang wrote:

Works for me, I'm redirected to the previous page, not the main page.

Here is the link that I get to update an issue from a version page:
/issues/bulk_update?back_url=http%3A%2F%2Flocalhost%3A3000%2Fversions%2F1&ids%5B%5D=753&issue%5Bstatus_id%5D=1

The difference is just the destination path %2Fversions%2F1. Maybe it's my version of ruby or rails? Which is yours?

Actions #5

Updated by Anonymous about 10 years ago

I could reproduce this issue at http://demo.redmine.org

  1. create a project
  2. go to the settings page of the newly created project
  3. click the versions tab
  4. create a new version, save it. you'll be redirected back correctly to the list of version on the settings/versions page
  5. then, edit the newly created version and save it again. You'll be redirected to the web site's home page.
Actions #6

Updated by Mischa The Evil about 10 years ago

Maurice M. wrote:

I could reproduce this issue at http://demo.redmine.org

I tested a local 2.5.1 deployment and was not able to reproduce.

1. create a project
2. go to the settings page of the newly created project
3. click the versions tab
4. create a new version, save it. you'll be redirected back correctly to the list of version on the settings/versions page

Until here everything is the same and working.

5. then, edit the newly created version and save it again. You'll be redirected to the web site's home page.

After I save the edited version I am being redirected back to the list of versions on the settings/versions page again.

Actions #7

Updated by Anonymous about 10 years ago

Ok, it seems to be a browser issue. I've been using Firefox 33.0. Just tested the same in Internet Explorer 11 which is working fine.

Actions #8

Updated by Anonymous about 10 years ago

It works on Firefox when setting the configuration key network.http.referer.trimmingPolicy to 0 or 1. It was set to 2 before.

0=send full URI, 1=scheme+host+port+path, 2=scheme+host+port

I wonder why the redirection works fine in other parts of Redmine but not with the versions pages?

Actions #9

Updated by Anonymous about 10 years ago

  • Status changed from New to Resolved

Redmine's redirections seems to rely on the HTTP referrer.

Actions #10

Updated by Mischa The Evil about 10 years ago

  • Subject changed from Wrong redirect after saving changes to a version to Wrong redirect after saving changes to a version (Firefox with network.http.referer.trimmingPolicy = 2)
  • Status changed from Resolved to Needs feedback
  • Assignee set to Jean-Philippe Lang
  • Resolution deleted (Cant reproduce)

Maurice M. wrote:

Ok, it seems to be a browser issue. I've been using Firefox 33.0. Just tested the same in Internet Explorer 11 which is working fine.

It works on Firefox when setting the configuration key network.http.referer.trimmingPolicy to 0 or 1. It was set to 2 before.

As far as I know '0' is the default value.

Maurice M. wrote:

Redmine's redirections seems to rely on the HTTP referrer.

Yes, it relies on HTTP referrers including the path part. You can take a look for yourself:

VersionsController#create source:/trunk/app/controllers/versions_controller.rb@13466#L99
ApplicationController#redirect_back_or_default source:/trunk/app/controllers/application_controller.rb@13466#L390
ApplicationController#back_url source:/trunk/app/controllers/application_controller.rb@13466#L382
ApplicationController#valid_back_url? source:/trunk/app/controllers/application_controller.rb@13466#L404
ApplicationController#redirect_to_referer_or source:/trunk/app/controllers/application_controller.rb@13466#L432
ApplicationHelper#back_url source:/trunk/app/helpers/application_helper.rb@13466#L1115

As a result of this, I am able to reproduce what you describe using FF33 with network.http.referer.trimmingPolicy set to 2. Nevertheless, I don't think that it can/should work properly with such a browser configuration.
For verification I'll let Jean-Philippe decide on closure of this issue...

Actions #11

Updated by Anonymous about 10 years ago

Mischa The Evil wrote:

<snip>
As a result of this, I am able to reproduce what you describe using FF33 with network.http.referer.trimmingPolicy set to 2. Nevertheless, I don't think that it can/should work properly with such a browser configuration.
For verification I'll let Jean-Philippe decide on closure of this issue...
<snip>

Ok, thank you Mischa! :) Maybe that's a requirement of Redmine that could be mentioned in the Redmine Guide or some documentation?

Actions #12

Updated by Jean-Philippe Lang about 10 years ago

  • Status changed from Needs feedback to Closed
  • Resolution set to Invalid

Mischa, thanks for the clarification!

Ok, thank you Mischa! :) Maybe that's a requirement of Redmine that could be mentioned in the Redmine Guide or some documentation?

I think it could be added to the FAQ.

Actions #13

Updated by Mischa The Evil about 10 years ago

Jean-Philippe Lang wrote:

...

I think it could be added to the FAQ.

FAQ-item added: FAQ.

Maurice Maurice M.: thanks for reporting this issue.

Actions

Also available in: Atom PDF