Defect #27333

Switching SCM fails after validation error in "New repository" page

Added by Mizuki ISHIKAWA about 1 month ago. Updated 4 days ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:SCM
Target version:3.3.6
Resolution:Fixed Affected version:

Description

Steps to reproduce:

  1. Open “New repository” ( /projects/:project_name/repositories/new )
  2. Click the Create button without making any changes.
  3. Change SCM (e.g. "Subversion" to "Git")
    ==> The input form does not change at all. As below.
Incorrect form for 'Git' Correct form for 'Git'

development.log:
There is an error "ActionController::RoutingError (No route matches [GET] "/projects/:project_name/repositories"):".

You can solve the problem by making the following changes.

diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb
index 314c0b29b..435041b72 100644
--- a/app/helpers/repositories_helper.rb
+++ b/app/helpers/repositories_helper.rb
@@ -138,7 +138,7 @@ module RepositoriesHelper
     select_tag('repository_scm',
                options_for_select(scm_options, repository.class.name.demodulize),
                :disabled => (repository && !repository.new_record?),
-               :data => {:remote => true, :method => 'get'})
+               :data => {:remote => true, :method => 'get', :url => new_project_repository_path(repository.project)})
   end

   def with_leading_slash(path)

correct_git.png (111 KB) Mizuki ISHIKAWA, 2017-10-31 08:03

incorrect_git.png (112 KB) Mizuki ISHIKAWA, 2017-10-31 08:03

Associated revisions

Revision 17105
Added by Go MAEDA 4 days ago

Switching SCM fails after validation error in "New repository" page (#27333).

Patch by Mizuki ISHIKAWA.

Revision 17106
Added by Go MAEDA 4 days ago

iMerged r17105 to 3.4-stable (#27333).

Patch by Mizuki ISHIKAWA.

Revision 17107
Added by Go MAEDA 4 days ago

Merged r17105 to 3.3-stable (#27333).

Patch by Mizuki ISHIKAWA.

History

#1 Updated by Toshi MARUYAMA 19 days ago

  • Status changed from New to Confirmed
  • Target version set to 3.4.4

LGTM.

#2 Updated by Go MAEDA 5 days ago

  • Target version changed from 3.4.4 to 3.3.6

Redmine 3.3 also is affected by this issue and the patch can be applied to 3.3-stable cleanly. Setting target version to 3.3.6.

#3 Updated by Go MAEDA 4 days ago

  • Subject changed from Switching SCM fail after repository creation fails to Switching SCM fails after validation error in "New repository" page
  • Status changed from Confirmed to Resolved
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed. Thank you for detecting and fixing this issue.

#4 Updated by Go MAEDA 4 days ago

  • Status changed from Resolved to Closed

Merged to stable branches.

Also available in: Atom PDF