我已经在Debian 7盒子上成功安装了Redmine。环境是:
Environment:
Redmine version 2.5.1.stable
Ruby version 1.9.3-p194 (2012-04-20) [x86_64-linux]
Rails version 3.2.17
Environment production
Database adapter Mysql2
SCM:
Git 1.7.10.4
Filesystem
Redmine plugins:
scrum 0.5.0
问题在于,当我点击"日历"选项卡,我收到以下错误:
500执行查询时发生错误并已记录。请将此错误报告给Redmine管理员。
我查看了Apache日志,这就是它所说的:
Query :: StatementInvalid:Mysql2 :: Error:Column' start_date' where子句不明确:SELECT
issues
。id
AS t0_r0,issues
。tracker_id
AS t0_r1,issues
。project_id
AS t0_r2,{ {1}}。issues
AS t0_r3,subject
。issues
AS t0_r4,description
。issues
AS t0_r5,due_date
。{{1 AS t0_r6,issues
。category_id
AS t0_r7,issues
。status_id
AS t0_r8,issues
。assigned_to_id
AS t0_r9,{{1 } {。{1}} AS t0_r10,issues
。priority_id
AS t0_r11,issues
。fixed_version_id
AS t0_r12,issues
。author_id
AS t0_r13,issues
。lock_version
AS t0_r14,issues
。created_on
AS t0_r15,issues
。updated_on
AS t0_r16,issues
。start_date
AS t0_r17,issues
。done_ratio
AS t0_r18,issues
。estimated_hours
AS t0_r19,issues
。parent_id
AS t0_r20 ,issues
。root_id
AS t0_r21,issues
。lft
AS t0_r22,issues
。rgt
AS t0_r23,issues
。{ {1}} AS t0_r24,is_private
。issues
AS t0_r25,closed_on
。issues
AS t1_r0,sprint_id
。issues
AS t1_r1,{ {1}}。position
AS t1_r2,projects
。id
AS t1_r3,projects
。name
AS t1_r4,projects
。{{1 AS t1_r5,description
。projects
AS t1_r6,homepage
。projects
AS t1_r7,is_public
。projects
AS t1_r8,{{1 } {。{1}} AS t1_r9,parent_id
。projects
AS t1_r10,created_on
。projects
AS t1_r11,updated_on
。projects
AS t1_r12,identifier
。projects
AS t1_r13,status
。projects
AS t2_r0,lft
。projects
AS t2_r1,rgt
。projects
AS t2_r 2,inherit_members
。projects
AS t2_r3,product_backlog_id
。issue_statuses
AS t2_r4,id
。issue_statuses
AS t2_r5,name
。issue_statuses
AS t3_r0,is_closed
。issue_statuses
AS t3_r1,is_default
。issue_statuses
AS t3_r2,position
。issue_statuses
AS t3_r3,default_done_ratio
。trackers
AS t3_r4,id
。trackers
AS t3_r5,name
。trackers
AS t4_r0,is_in_chlog
。{{ 1}} AS t4_r1,trackers
。position
AS t4_r2,trackers
。is_in_roadmap
AS t4_r3,trackers
。fields_bits
AS t4_r4,{{ 1}}。users
AS t4_r5,id
。users
AS t4_r6,login
。users
AS t4_r7,hashed_password
。{{1} } AS t4_r8,users
。firstname
AS t4_r9,users
。lastname
AS t4_r10,users
。users
AS t4_r12,admin
。users
AS t4_r13,status
。users
AS t4_r14,last_login_on
。users
AS t4_r15,language
。users
AS t4_r16,auth_source_id
。users
AS t4_r17,created_on
。users
AS t5_r0,updated_on
。users
AS t5_r1,type
。users
AS t5_r2,identity_url
。users
AS t5_r3,mail_notification
。users
AS t5_r4,salt
。users
AS t5_r5,must_change_passwd
。enumerations
AS t5_r6,id
。enumerations
AS t5_r7,name
。{{ 1}} AS t5_r8,enumerations
。position
AS t6_r0,enumerations
。is_default
AS t6_r1,enumerations
。type
AS t6_r2,{{ 1}}。enumerations
AS t6_r3,active
。enumerations
AS t6_r4,project_id
。enumerations
AS t6_r5,parent_id
。{{1} } AS t6_r6,enumerations
。position_name
AS t6_r7,sprints
。id
AS t6_r8,sprints
。name
AS t6_r9来自sprints
内部加入description
开启sprints
。start_date
=sprints
。end_date
INNER JOINsprints
ONuser_id
。sprints
=project_id
。sprints
LEFT OUTER JOINcreated_on
ONsprints
。{{1} } =updated_on
。sprints
LEFT OUTER JOINis_product_backlog
ONissues
。issue_statuses
=issue_statuses
。id
LEFT OUTER JOIN {{ 1}} ONissues
。status_id
=projects
。projects
和id
。issues
IN(' IssuePriority') LEFT OUTER JOINproject_id
ONtrackers
。trackers
=id
。issues
WHERE(projects.status<> 9 AND projects.id IN(SELECT em.project_id FROM enabled_modules em WHERE em.name =' issue_tracking'))AND((issues.status_id IN(SELECT id FROM issue_statuses WHERE is_closed = 0))AND项目。 id IN(1,2))AND(((start_date BETWEEN' 2014-03-30' AND' 2014-05-03')或(due_date BETWEEN' 2014- 03-30' AND' 2014-05-03')))
有任何线索吗?
答案 0 :(得分:2)
Mysql2 ::错误:where子句中的列'start_date'不明确:
当你得到这个错误的时候,插件的列号名称与redmine列名相同。
例如:起始日期
插件列表
1.scrum 2.holidays
这两个插件具有相同的列名start_date。
所以一个解决方案是 1.转到calendars.controller并找到此行
events + = @ query.issues(:include => [:tracker,:assigned_to,:priority], :conditions => [“(( start_date BETWEEN?AND?)或(due_date BETWEEN?AND?))”,@ calendar.startdt,@ calendar.enddt,@ calendar.startdt,@ calendar.enddt] )
在此行中将start_date更改为issues.start_date。
所以应该看起来像..
events + = @ query.issues(:include => [:tracker,:assigned_to,:priority], :conditions => [“(( issues.start_date BETWEEN?AND?)或(due_date BETWEEN?AND?))”,@ calendar.startdt,@ calendar.enddt,@ calendar.startdt,@ calendar.enddt] )
重启服务器......
答案 1 :(得分:1)
您需要修改redmine / app / controller / calendar_controller.rb文件。
在start_date和due_date之前添加问题,如下所示:
events + = @ query.issues(:include => [:tracker,:assigned_to,:priority], :conditions => ["((issues.start_date BETWEEN?AND?)OR(issues.due_date BETWEEN?AND?))",@ calendar.startdt,@ calendar.enddt,@ calendar.startdt,@ calendar.enddt ] )
并重启Redmine。