I'm looking for a part-time remote job.

Hire me


I'm the author of:

Mastering Redmine is a comprehensive guide with tips, tricks and best practices, and an easy-to-learn structure.

Check the book's project or

Buy the book

Social pages of the book:

By buying this book you also donate to Redmine (see this page).


Follow me:

Bug #2183

Internal error: Can't show repository format error message.

Added by Jun NAITOH about 11 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
14 Apr 2013
Due date:
19 May 2013
% Done:

100%

Redmine version:
2.2
External issue:

Description

my environment

  • CentOS Linux release 6.0
  • Redmine 1.4.3
  • i18n gem (0.4.2)
  • config/scm.yml
    production:
    
      svn:
        path: /var/lib/svn
        svnadmin: /usr/bin/svnadmin
        url: svn
    

Reappearance procedure

  1. in test project
  2. Settings → Repositorys → New repository
  3. URL change to file:///var/lib/svn_ng/test from file:///var/lib/svn/test.
  4. [Create new repositorie] click.
  5. Internal error
    Processing RepositoriesController#create (for 192.168.56.1 at 2013-04-14 08:37:58) [POST]
      Parameters: {"repository"=>{"is_default"=>"1", "url"=>"file:///var/lib/svn_ng/test", "login"=>"", "identifier"=>""}, "commit"=>"Create new repository", "project_id"=>"test", "action"=>"create", "authenticity_token"=>"vFfd3GwhXRMvt0uK8HnQfQxM0hVqgl0mZm5CYJxVVog=", "controller"=>"repositories", "ignore"=>"", "operation"=>"add", "repository_scm"=>"Subversion"}
    
    NoMethodError (undefined method `l' for SubversionCreator:Class):
      passenger (3.0.8) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
      passenger (3.0.8) lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
      passenger (3.0.8) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
    

I expect that the message of 'URL should be of format “file:///var/lib/svn/<repository>/”' will be displayed.

  • patch
    --- redmine_scm_org/lib/creator/scm_creator.rb    2012-11-28 23:58:33.000000000 +0900
    +++ redmine_scm/lib/creator/scm_creator.rb    2013-04-14 11:10:44.555537599 +0900
    @@ -1,4 +1,5 @@
     class SCMCreator
    +    include Redmine::I18n
    
         class << self
    
    diff -ru redmine_scm_org/lib/creator/subversion_creator.rb redmine_scm/lib/creator/subversion_creator.rb
    --- redmine_scm_org/lib/creator/subversion_creator.rb    2012-05-31 18:43:09.000000000 +0900
    +++ redmine_scm/lib/creator/subversion_creator.rb    2013-04-14 11:23:22.421734664 +0900
    @@ -1,4 +1,5 @@
     class SubversionCreator < SCMCreator
    +    include Redmine::I18n
    
         class << self
    

However, even if it uses this patch, in Redmine 2.2 (i18n (0.6.4)), other errors still occur.

Started POST "/223/projects/test/repositories" for 192.168.56.1 at Sun Apr 14 12:09:11 +0900 2013
Processing by RepositoriesController#create as HTML
  Parameters: {"commit"=>"Create new repository", "repository"=>{"is_default"=>"1", "url"=>"file:///var/lib/svn_ng/test", "identifier"=>"", "login"=>""}, "project_id"=>" 
test", "authenticity_token"=>"yz5R2Pg21mbYJBVhe5gfz0F2KxN955R9y4vxfLoUe0A=", "utf8"=>"✓", "operation"=>"add", "ignore"=>"", "repository_scm"=>"Subversion"}
  Current user: admin (id=1)
Completed 500 Internal Server Error in 11ms

I18n::ReservedInterpolationKey (reserved key :format used in "should be of format \"%{format}\""):
  i18n (0.6.4) lib/i18n/interpolate/ruby.rb:13:in `interpolate'
  i18n (0.6.4) lib/i18n/backend/base.rb:148:in `interpolate'
  i18n (0.6.4) lib/i18n/backend/base.rb:41:in `translate'
  i18n (0.6.4) lib/i18n/backend/fallbacks.rb:38:in `translate'
  i18n (0.6.4) lib/i18n.rb:156:in `translate'
  i18n (0.6.4) lib/i18n.rb:152:in `catch'
  i18n (0.6.4) lib/i18n.rb:152:in `translate'
  i18n (0.6.4) lib/i18n/backend/base.rb:114:in `resolve'
  i18n (0.6.4) lib/i18n/backend/base.rb:111:in `catch'
  i18n (0.6.4) lib/i18n/backend/base.rb:111:in `resolve'
  i18n (0.6.4) lib/i18n/backend/base.rb:98:in `default'
  i18n (0.6.4) lib/i18n/backend/base.rb:97:in `each'
  i18n (0.6.4) lib/i18n/backend/base.rb:97:in `default'
  i18n (0.6.4) lib/i18n/backend/base.rb:34:in `translate'
  i18n (0.6.4) lib/i18n/backend/fallbacks.rb:44:in `translate'
  i18n (0.6.4) lib/i18n/backend/fallbacks.rb:43:in `catch'
  i18n (0.6.4) lib/i18n/backend/fallbacks.rb:43:in `translate'
  i18n (0.6.4) lib/i18n/backend/fallbacks.rb:42:in `each'
  i18n (0.6.4) lib/i18n/backend/fallbacks.rb:42:in `translate'
  i18n (0.6.4) lib/i18n.rb:156:in `translate'
  i18n (0.6.4) lib/i18n.rb:152:in `catch'
  i18n (0.6.4) lib/i18n.rb:152:in `translate'
  activemodel (3.2.12) lib/active_model/errors.rb:351:in `generate_message'
  activemodel (3.2.12) lib/active_model/errors.rb:359:in `normalize_message'
  activemodel (3.2.12) lib/active_model/errors.rb:234:in `add'
  plugins/redmine_scm/lib/scm_repositories_controller_patch.rb:248:in `scm_create_repository'
  plugins/redmine_scm/lib/scm_repositories_controller_patch.rb:82:in `create'

It is because ":format” was added to the reserved key of i18n gem 0.6.x.
And Redmine 2.x use i18n 0.6.

  • additional patch (Sorry, this patch is English local only example.)
    diff -ru redmine_scm_org/config/locales/en.yml redmine_scm/config/locales/en.yml
    --- redmine_scm_org/config/locales/en.yml    2013-04-14 12:13:56.839754795 +0900
    +++ redmine_scm/config/locales/en.yml    2013-04-14 12:13:43.045719205 +0900
    @@ -14,7 +14,7 @@
       activerecord:
         errors:
           messages:
    -        should_be_of_format_local: should be of format "%{format}" 
    +        should_be_of_format_local: should be of format "%{repository_format}" 
             already_exists: already exists
             scm_not_supported: This SCM is not supported
             repository_exists_for_identifier: Repository already exists for this project identifier
    --- redmine_scm_org/lib/scm_repositories_controller_patch.rb    2013-04-14 12:13:56.834009249 +0900
    +++ redmine_scm/lib/scm_repositories_controller_patch.rb    2013-04-14 12:13:43.044869502 +0900
    @@ -245,7 +245,7 @@
                         flash[:warning] = l(:text_cannot_be_used_redmine_auth)
                     end
                 else
    -                repository.errors.add(:url, :should_be_of_format_local, :format => interface.repository_format)
    +                repository.errors.add(:url, :should_be_of_format_local, :repository_format => interface.repository_format)
                 end
    
                 # Otherwise input field will be disabled
    

Associated revisions

Revision 122 (diff)
Added by Andriy Lesyuk almost 11 years ago

Applied fixes for #2135, #2137 and #2183

History

#1 Updated by Andriy Lesyuk almost 11 years ago

  • Status changed from New to Open
  • Assignee set to Andriy Lesyuk
  • Target version set to 0.4.3

#2 Updated by Andriy Lesyuk almost 11 years ago

  • Due date set to 19 May 2013
  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Thank you very much, Jun!

Also available in: Atom PDF

Terms of use | Privacy policy