Package: redmine
Version: 3.0~20140825-5
Severity: normal
Tags: patch

Dear Maintainer,

Since upgrading from wheezy to jessie (i.e. to redmine 3.0~20140825-5) it is
not possible to move issues between projects.

When, after pressing edit on the issue, I choose the new project from the drop
down list it switches back to the original project after about one second.
This means that I am unable to save the change (because it is reverted before I
can save it).

I don't see this bug reported upstream in either version 2.5 or 3.0 so I am
wondering if this is a debian specific bug, or maybe an issue which was in
2.5.2.devel (which is what this version claims to be) which was fixed upstream
before release.

The bug does not occur in the version in wheezy-backports (2.5.1.stable) (using
an install which was based on a copy of the same database).

It looks like the way this works is that the browser calls
issues/update_form.js which seems to reload the form, however, it loads it with
the origional project.

Looking upstream at the official 3.0 release it seems that the update_form 
action
in issues_controller.rb has been removed.

So, I have made a fix with the attached patch (basically we always load the
project from the issue[project_id] parameter and ignore the project_id from the
URL when running update_form).





-- System Information:
Debian Release: 8.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages redmine depends on:
ii  bundler                         1.7.4-1
ii  dbconfig-common                 1.8.47+nmu3
ii  debconf [debconf-2.0]           1.5.56
ii  libjs-scriptaculous             1.9.0-2
ii  redmine-mysql                   3.0~20140825-5
ii  redmine-sqlite                  3.0~20140825-5
ii  ruby                            1:2.1.5
ii  ruby-actionpack-action-caching  1.1.1-3
ii  ruby-awesome-nested-set         3.0.0-1
ii  ruby-coderay                    1.1.0-2
ii  ruby-i18n                       0.6.9-2
ii  ruby-jquery-rails               3.1.2-2
ii  ruby-mime-types                 1.25-2
ii  ruby-net-ldap                   0.8.0-1
ii  ruby-openid                     2.5.0debian-1
ii  ruby-protected-attributes       1.0.8-2
ii  ruby-rack                       1.5.2-3
ii  ruby-rack-openid                1.4.2-1
ii  ruby-rails                      2:4.1.8-1
ii  ruby-rails-observers            0.1.1-1
ii  ruby-redcarpet                  3.1.2-1
ii  ruby-request-store              1.1.0-1
ii  ruby-rmagick                    2.13.2-4+b1
ii  ruby2.1 [ruby-interpreter]      2.1.5-2

Versions of packages redmine recommends:
ii  libfcgi-ruby1.9.1              0.9.2.1-1
ii  ruby-fcgi [libfcgi-ruby1.9.1]  0.9.2.1-1+b3
ii  ruby-passenger                 4.0.53-1

Versions of packages redmine suggests:
pn  bzr         <none>
pn  cvs         <none>
pn  darcs       <none>
ii  git         1:2.1.4-2.1
pn  mercurial   <none>
ii  subversion  1.8.10-6

-- debconf information:
  redmine/notify-migration:
  redmine/old-instances:
  redmine/instances/default/pgsql/admin-user: postgres
  redmine/instances/default/remove-error: abort
  redmine/instances/default/internal/skip-preseed: true
* redmine/current-instances: default
  redmine/instances/default/dbconfig-upgrade: true
  redmine/instances/default/passwords-do-not-match:
  redmine/instances/default/upgrade-backup: true
  redmine/instances/default/db/basepath:
* redmine/instances/default/db/app-user: redmine
  redmine/instances/default/pgsql/changeconf: false
  redmine/instances/default/pgsql/no-empty-passwords:
* redmine/missing-redmine-package:
  redmine/instances/default/pgsql/manualconf:
* redmine/instances/default/default-language: en-gb
* redmine/instances/default/mysql/method: tcp/ip
  redmine/instances/default/purge: false
  redmine/instances/default/pgsql/method: unix socket
  redmine/default-language: ${defaultLocale}
* redmine/instances/default/remote/port:
  redmine/instances/default/install-error: retry
* redmine/instances/default/dbconfig-install: true
  redmine/instances/default/missing-db-package-error: abort
* redmine/instances/default/mysql/admin-user: root
  redmine/instances/default/pgsql/authmethod-admin: ident
  redmine/instances/default/upgrade-error: abort
  redmine/instances/default/dbconfig-remove:
  redmine/instances/default/pgsql/authmethod-user: password
* redmine/instances/default/database-type: mysql
  redmine/instances/default/internal/reconfiguring: true
* redmine/instances/default/db/dbname: redmine_default
* redmine/instances/default/dbconfig-reinstall: false

-- debsums errors found:
debsums: changed file /usr/share/redmine/app/controllers/issues_controller.rb 
(from redmine package)
--- redmine_3.0~20140825-5_orig/usr/share/redmine/app/controllers/issues_controller.rb	2014-07-09 18:29:52.000000000 +0100
+++ /usr/share/redmine/app/controllers/issues_controller.rb	2015-04-29 13:35:09.000000000 +0100
@@ -21,7 +21,8 @@
 
   before_filter :find_issue, :only => [:show, :edit, :update]
   before_filter :find_issues, :only => [:bulk_edit, :bulk_update, :destroy]
-  before_filter :find_project, :only => [:new, :create, :update_form]
+  before_filter :find_project, :only => [:new, :create]
+  before_filter :find_project_from_issue, :only => [:update_form]
   before_filter :authorize, :except => [:index]
   before_filter :find_optional_project, :only => [:index]
   before_filter :check_for_default_issue_status, :only => [:new, :create]
@@ -352,6 +353,13 @@
     render_404
   end
 
+  def find_project_from_issue
+    project_id = (params[:issue] && params[:issue][:project_id])
+    @project = Project.find(project_id)
+  rescue ActiveRecord::RecordNotFound
+    render_404
+  end
+
   def retrieve_previous_and_next_issue_ids
     retrieve_query_from_session
     if @query
@@ -419,7 +427,7 @@
       end
       @issue.project = @project
     else
-      @issue = @project.issues.visible.find(params[:id])
+      @issue = Issue.visible.find(params[:id])
     end
 
     @issue.project = @project

Reply via email to