Project

General

Profile

Defect #1257

Sprint link in calendar redirects to localhost

Added by Bartosz Firyn over 7 years ago. Updated over 7 years ago.

Status:
Resolved
Priority:
Normal
Category:
Calendar
Target version:
Source:
Testing
Detected on version:
Blocked:
No
Alone:
Milestones:
Sprint:

Description

Hi,

I'm using 0.15.0 scrum plugin. My Redmine is running on a server on port 3000, but I can access it via nginx proxypass. The problem is that link to sprint in calendar points to localhost.

My nginx settings:

    server {
        server_name myinternaldomain.com;
        location / {
            proxy_pass http://localhost:3000;
            proxy_redirect default;
            proxy_cookie_domain localhost  myinternaldomain.com;
        }
    }

All other Redmine links (including calendar ones) works well. Just sprint link is broken.


Files

1.png (22.9 KB) 1.png Bartosz Firyn, 2016-11-29 13:24
2.png (31.6 KB) 2.png Bartosz Firyn, 2016-12-08 18:53
0001-Fix-broken-sprint-link-in-calendar.patch (1.12 KB) 0001-Fix-broken-sprint-link-in-calendar.patch Bartosz Firyn, 2016-12-08 18:57

Subtasks

To do #1271: Apply & test provided patchResolvedEmilio González MontañaActions
#1

Updated by Emilio González Montaña over 7 years ago

I cannot reproduce this, please go to plugin folder and open this file lib/scrum/calendars_controller_patch.rb, change this (at the end of the file):

            sprints << {:name => sprint.name,
                        :url => url_for(:controller => :sprints,
                                        :action => :show,
                                        :id => sprint.id),
                        :day => sprint.send(date_field).day,
                        :week => sprint.send(date_field).cweek,
                        :start => start}

With this new code:

            sprints << {:name => sprint.name,
                        :url => url_for(sprint),
                        :day => sprint.send(date_field).day,
                        :week => sprint.send(date_field).cweek,
                        :start => start}

If it works let me know and I will fix the sources.

#2

Updated by Bartosz Firyn over 7 years ago

Hi Emilio,

Thank you for pointing me to the source code. The change you proposed is not working, but after reading more about function url_for(..):

http://apidock.com/rails/ActionView/RoutingUrlFor/url_for

I added :only_path option set to true and now it works well:

Versus how it was before:

Code:

                        :url => url_for(:controller => :sprints,
                                        :action => :show,
                                        :id => sprint.id,
                                        :only_path => true),

Attached I'm sending patch file.

#3

Updated by Emilio González Montaña over 7 years ago

  • Target version set to Scrum v0.16.2
  • Sprint set to Sprint 32
#4

Updated by Emilio González Montaña over 7 years ago

  • Status changed from In progress to Resolved

Also available in: Atom PDF