kayamaox / redmine-dmsf

Automatically exported from code.google.com/p/redmine-dmsf
0 stars 0 forks source link

showing details for a file that has been downloaded fails #104

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. add a file
2. click on show details -> works
3. download this file
4. click on show details -> Internal Error

What is the expected output? What do you see instead?
the output would be the details of the file, instead I get an internal error. 

What version of the DMSF and Redmine are you using? On what browser and
operating system?

dmsf is svn revision 180, redmine is on revision 6126, running on Ubuntu 
10.04.2 LTS 64bit using ruby 1.8.7 (ruby enterprise edition 2010.02) and 
passenger 3.0.2

Please provide any additional information below.
The output of the redmine log file:

Rendering template within layouts/base
Rendering dmsf_files/show

ActionView::TemplateError (can't convert String into Integer) on line #14 of 
vendor/plugins/redmine_dmsf/app/views/dmsf_files/_revision_access.html.erb:
11:             <tbody>
12: <% revision.access_grouped.each do |access| %>
13:                     <tr>
14:                             <td><%=h(User.find(access["user_id"]))%></td>
15:                             <td><%=access["count"]%></td>
16:                             
<td><%=Time.parse(access["min"]).to_s(:db)%></td>
17:                             
<td><%=Time.parse(access["max"]).to_s(:db)%></td>

    vendor/plugins/redmine_dmsf/app/views/dmsf_files/_revision_access.html.erb:14:in `[]'
    vendor/plugins/redmine_dmsf/app/views/dmsf_files/_revision_access.html.erb:14
    vendor/plugins/redmine_dmsf/app/views/dmsf_files/_revision_access.html.erb:12:in `each'
    vendor/plugins/redmine_dmsf/app/views/dmsf_files/_revision_access.html.erb:12
    vendor/plugins/redmine_dmsf/app/views/dmsf_files/show.html.erb:117
    vendor/plugins/redmine_dmsf/app/views/dmsf_files/show.html.erb:50:in `each'
    vendor/plugins/redmine_dmsf/app/views/dmsf_files/show.html.erb:50
    vendor/plugins/redmine_dmsf/app/controllers/dmsf_files_controller.rb:59:in `show'

Original issue reported on code.google.com by C.Schu...@gmail.com on 29 Jun 2011 at 8:52

GoogleCodeExporter commented 8 years ago
What database are you using? Could you attach content of 
dmsf_file_revision_accesses table?

Original comment by vit.jo...@gmail.com on 29 Jun 2011 at 11:43

GoogleCodeExporter commented 8 years ago
I'm using mysql 5.1.41 (-3ubuntu12.10)

Here is the SQL code for the yet very small table:

# --------------------------------------------------------
# Host:                         0.0.0.0
# Server version:               5.1.41-3ubuntu12.10
# Server OS:                    debian-linux-gnu
# HeidiSQL version:             6.0.0.3655
# Date/time:                    2011-06-29 13:47:36
# --------------------------------------------------------

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 
*/;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;

# Dumping structure for table redmine.dmsf_file_revision_accesses
CREATE TABLE IF NOT EXISTS `dmsf_file_revision_accesses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `dmsf_file_revision_id` int(11) NOT NULL,
  `action` int(11) NOT NULL DEFAULT '0',
  `user_id` int(11) NOT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8;

# Dumping data for table redmine.dmsf_file_revision_accesses: ~14 rows 
(approximately)
/*!40000 ALTER TABLE `dmsf_file_revision_accesses` DISABLE KEYS */;
INSERT INTO `dmsf_file_revision_accesses` (`id`, `dmsf_file_revision_id`, 
`action`, `user_id`, `created_at`, `updated_at`) VALUES
    (1, 14, 0, 5, '2011-06-23 15:45:53', '2011-06-23 15:45:53'),
    (2, 16, 0, 5, '2011-06-23 15:48:27', '2011-06-23 15:48:27'),
    (3, 22, 0, 99, '2011-06-29 10:20:54', '2011-06-29 10:20:54'),
    (4, 22, 0, 99, '2011-06-29 10:23:17', '2011-06-29 10:23:17'),
    (5, 22, 0, 5, '2011-06-29 10:23:38', '2011-06-29 10:23:38'),
    (6, 23, 0, 99, '2011-06-29 10:24:11', '2011-06-29 10:24:11'),
    (7, 18, 0, 7, '2011-06-29 10:28:00', '2011-06-29 10:28:00'),
    (8, 19, 0, 7, '2011-06-29 10:28:34', '2011-06-29 10:28:34'),
    (9, 18, 0, 5, '2011-06-29 10:33:44', '2011-06-29 10:33:44'),
    (10, 19, 0, 5, '2011-06-29 10:46:00', '2011-06-29 10:46:00'),
    (11, 21, 0, 5, '2011-06-29 10:46:21', '2011-06-29 10:46:21'),
    (12, 27, 0, 5, '2011-06-29 10:47:34', '2011-06-29 10:47:34'),
    (13, 27, 1, 5, '2011-06-29 10:48:00', '2011-06-29 10:48:00'),
    (14, 27, 0, 5, '2011-06-29 10:48:05', '2011-06-29 10:48:05');
/*!40000 ALTER TABLE `dmsf_file_revision_accesses` ENABLE KEYS */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;

Original comment by C.Schu...@gmail.com on 29 Jun 2011 at 11:48

GoogleCodeExporter commented 8 years ago
Could you please attach result of following sql select?

select user_id as uid, count(*) as ucount, min(created_at) as umin, 
max(created_at) as umax from dmsf_file_revision_accesses where 
dmsf_file_revision_id = 27 group by user_id

Original comment by vit.jo...@gmail.com on 29 Jun 2011 at 11:57

GoogleCodeExporter commented 8 years ago
the result is:

"uid";"ucount";"umin";"umax"
"5";"3";"2011-06-29 10:47:34";"2011-06-29 10:48:05"

Original comment by C.Schu...@gmail.com on 29 Jun 2011 at 12:09

GoogleCodeExporter commented 8 years ago

Original comment by vit.jo...@gmail.com on 29 Jun 2011 at 1:55

GoogleCodeExporter commented 8 years ago
Thanks a lot for the quick fix. It works now! :D

Original comment by C.Schu...@gmail.com on 29 Jun 2011 at 2:07

GoogleCodeExporter commented 8 years ago

Original comment by vit.jo...@gmail.com on 11 Jul 2011 at 2:27