eckucukoglu / redmine-issue-statistics

http://www.redmine.org/plugins/issuestats
10 stars 4 forks source link

Does this plugin needs database migration? #14

Closed myaspm closed 7 years ago

myaspm commented 8 years ago

Cloned it, restarted the redmine but getting Redmine 404 Page not found error.

martinvonwittich commented 7 years ago

Yeah, it seems to break the ticket view. I immediately uninstalled it.

Started GET "/issues/2134" for 2003:a:422:3ba0:9e5c:8eff:fe73:fd8f at 2016-11-29 18:06:16 +0100
Processing by IssuesController#show as HTML
  Parameters: {"id"=>"2134"}
  Current user: martin.von.wittich (id=9)
  Rendered issues/_action_menu.html.erb (2.0ms)
  Rendered issues/show.html.erb within layouts/base (15.1ms)
Missing template, responding with 404
  Rendered common/error.html.erb within layouts/base (0.1ms)
Completed 404 Not Found in 63ms (Views: 5.1ms | ActiveRecord: 15.5ms)
martinvonwittich commented 7 years ago

OK, I think I found my mistake - the plugin folder has to be named "issuestats", not "redmine-issue-statistics". Clone it like this:

git clone 'https://github.com/eckucukoglu/redmine-issue-statistics.git' issuestats

At least now it no longer breaks Redmine completely. But I still can't figure out how to actually use it.

eckucukoglu commented 7 years ago

thanks @martinvonwittich i will try to spend some time to solve #13. @myaspm could you please inform us, after rename the plugin folder as issuestats.

myaspm commented 7 years ago

Yeah it doesn't crash Redmine now. :D But still, it doesn't work if there are issues between selected time interval. If not, it returns a standart no issue found error. Edit : It might be a problem with postgresql (as always :/)

ActionView::Template::Error (PG::UndefinedTable: ERROR: relation "issue_start_times" does not exist LINE 5: WHERE a.attrelid = '"issue_start_times"'::reg... ^ : SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"issue_start_times"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum ): 106: <% @priorities.each do |priority| %> 107: 108: <% issues_t_p = @issues.where(:tracker_id => tracker.id).where(:priority_id => priority.id) %> 109: <% results = get_time_statistics(issues_t_p, @intervention_time, @resolve_time, @intervention_status, @resolve_status) %> 110: <% results.each do |result| %> 111: <%= result %>
112: <% end %> plugins/issuestats/app/helpers/issuestats_helper.rb:3:in get_issue_intervention_time' plugins/issuestats/app/helpers/issuestats_helper.rb:101:inblock in get_time_statistics' plugins/issuestats/app/helpers/issuestats_helper.rb:100:in get_time_statistics' plugins/issuestats/app/views/issuestats/show.html.erb:109:inblock (2 levels) in _plugins_issuestats_app_views_issuestats_show_html_erb_176932288217975088_69830971084520' plugins/issuestats/app/views/issuestats/show.html.erb:106:in `block in _plugins_issuestats_app_views_issuestats_show_htmlerb176932288217975088_69830971084520' plugins/issuestats/app/views/issuestats/show.html.erb:103:in _plugins_issuestats_app_views_issuestats_show_html_erb___176932288217975088_69830971084520' lib/redmine/sudo_mode.rb:63:insudo_mode'

eckucukoglu commented 7 years ago

by the way, to record issue start times, you need to make db migration, it creates issue_start_times table to store issue-datetime pairs. after migration, if any issue has not a start time, then start date is counted as start time with 0h:0m added.

myaspm commented 7 years ago

yeah i completely forgot about that, seems to be working fine now.