@@ -329,4 +329,13 class ApplicationController < ActionController::Base | |||
|
329 | 329 | def render_attachment_warning_if_needed(obj) |
|
330 | 330 | flash[:warning] = l(:warning_attachments_not_saved, obj.unsaved_attachments.size) if obj.unsaved_attachments.present? |
|
331 | 331 | end |
|
332 | ||
|
333 | # Rescues an invalid query statement. Just in case... | |
|
334 | def query_statement_invalid(exception) | |
|
335 | logger.error "Query::StatementInvalid: #{exception.message}" if logger | |
|
336 | session.delete(:query) | |
|
337 | sort_clear if respond_to?(:sort_clear) | |
|
338 | render_error "An error occurred while executing the query and has been logged. Please report this error to your Redmine administrator." | |
|
339 | end | |
|
340 | ||
|
332 | 341 | end |
@@ -7,6 +7,8 class GanttsController < ApplicationController | |||
|
7 | 7 | helper :projects |
|
8 | 8 | helper :queries |
|
9 | 9 | include QueriesHelper |
|
10 | helper :sort | |
|
11 | include SortHelper | |
|
10 | 12 | include Redmine::Export::PDF |
|
11 | 13 | |
|
12 | 14 | def show |
@@ -42,15 +44,6 class GanttsController < ApplicationController | |||
|
42 | 44 | |
|
43 | 45 | private |
|
44 | 46 | |
|
45 | # Rescues an invalid query statement. Just in case... | |
|
46 | # TODO: Refactor, move to ApplicationController with IssuesController | |
|
47 | def query_statement_invalid(exception) | |
|
48 | logger.error "Query::StatementInvalid: #{exception.message}" if logger | |
|
49 | session.delete(:query) | |
|
50 | sort_clear | |
|
51 | render_error "An error occurred while executing the query and has been logged. Please report this error to your Redmine administrator." | |
|
52 | end | |
|
53 | ||
|
54 | 47 | # TODO: Refactor, duplicates IssuesController |
|
55 | 48 | def find_optional_project |
|
56 | 49 | @project = Project.find(params[:project_id]) unless params[:project_id].blank? |
@@ -453,14 +453,6 private | |||
|
453 | 453 | render_404 |
|
454 | 454 | end |
|
455 | 455 | |
|
456 | # Rescues an invalid query statement. Just in case... | |
|
457 | def query_statement_invalid(exception) | |
|
458 | logger.error "Query::StatementInvalid: #{exception.message}" if logger | |
|
459 | session.delete(:query) | |
|
460 | sort_clear | |
|
461 | render_error "An error occurred while executing the query and has been logged. Please report this error to your Redmine administrator." | |
|
462 | end | |
|
463 | ||
|
464 | 456 | # Used by #edit and #update to set some common instance variables |
|
465 | 457 | # from the params |
|
466 | 458 | # TODO: Refactor, not everything in here is needed by #edit |
General Comments 0
You need to be logged in to leave comments.
Login now