Project

General

Profile

Actions

Defect #19253

closed

Repository users broken if only one committer exists

Added by Kevin Neuenfeldt over 9 years ago. Updated over 9 years ago.

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

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

First thanks for the great work and the new major version.

I just updated from 2.6.1 to 3.0.0. My environment looks like the following:

Environment:
  Redmine version                3.0.0.stable
  Ruby version                   1.9.3-p484 (2013-11-22) [x86_64-linux]
  Rails version                  4.2.0
  Environment                    production
  Database adapter               PostgreSQL

When I navigate to the repository tab of a projects settings where only one committer contributed to the repository and click on "Users" I get the following error:

Started GET "/repositories/8/committers" for xxx at 2015-03-03 12:02:24 +0100
Processing by RepositoriesController#committers as HTML
  Parameters: {"id"=>"8"}
  Current user: xxx (id=1)
Completed 500 Internal Server Error in 18ms

NoMethodError (undefined method `compact!' for #<User::ActiveRecord_Relation:0x007f8d1586a480>):
  app/controllers/repositories_controller.rb:98:in `committers'

This does not happen if the repository I want to configure has more than one contributor.

Actions #1

Updated by Toshi MARUYAMA over 9 years ago

  • Target version set to 3.0.1
Actions #2

Updated by Dmitry Popov over 9 years ago

I fixed it by adding .to_a on line 97

@users = @project.users.to_a
Actions #3

Updated by Jean-Philippe Lang over 9 years ago

  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

Fix committed in r14053 with a test. Thanks for pointing this out.

Actions #4

Updated by Jean-Philippe Lang over 9 years ago

  • Status changed from Closed to Resolved
Actions #5

Updated by Jean-Philippe Lang over 9 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF