Prevent problem with finding data
This commit is contained in:
parent
43767189ac
commit
44b1b84a41
@ -1,6 +1,11 @@
|
|||||||
Changelog
|
Changelog
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
2.0.12
|
||||||
|
++++++
|
||||||
|
|
||||||
|
- More robust code for dealing with finding data
|
||||||
|
|
||||||
2.0.11
|
2.0.11
|
||||||
++++++
|
++++++
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ module AdditionalsQueriesHelper
|
|||||||
sort_criteria: params[:sort].presence || @query.sort_criteria.to_a)
|
sort_criteria: params[:sort].presence || @query.sort_criteria.to_a)
|
||||||
else
|
else
|
||||||
# retrieve from session
|
# retrieve from session
|
||||||
@query = query_class.find(session["#{object_type}_query".to_sym][:id]) if session["#{object_type}_query".to_sym][:id]
|
@query = query_class.find_by(id: session["#{object_type}_query".to_sym][:id]) if session["#{object_type}_query".to_sym][:id]
|
||||||
session_data = Rails.cache.read(additionals_query_cache_key(object_type))
|
session_data = Rails.cache.read(additionals_query_cache_key(object_type))
|
||||||
@query ||= query_class.new(name: '_',
|
@query ||= query_class.new(name: '_',
|
||||||
filters: session_data.nil? ? nil : session_data[:filters],
|
filters: session_data.nil? ? nil : session_data[:filters],
|
||||||
|
@ -28,9 +28,9 @@ copyright = u'2013-2018, AlphaNodes GmbH'
|
|||||||
author = u'Alexander Meindl'
|
author = u'Alexander Meindl'
|
||||||
|
|
||||||
# The short X.Y version.
|
# The short X.Y version.
|
||||||
version = u'2.0.9'
|
version = u'2.0.12'
|
||||||
# The full version, including alpha/beta/rc tags.
|
# The full version, including alpha/beta/rc tags.
|
||||||
release = u'2.0.9'
|
release = u'2.0.12'
|
||||||
|
|
||||||
# List of patterns, relative to source directory, that match files and
|
# List of patterns, relative to source directory, that match files and
|
||||||
# directories to ignore when looking for source files.
|
# directories to ignore when looking for source files.
|
||||||
|
2
init.rb
2
init.rb
@ -4,7 +4,7 @@ Redmine::Plugin.register :additionals do
|
|||||||
name 'Additionals'
|
name 'Additionals'
|
||||||
author 'AlphaNodes GmbH'
|
author 'AlphaNodes GmbH'
|
||||||
description 'Customizing Redmine, providing wiki macros and act as a library/function provider for other Redmine plugins'
|
description 'Customizing Redmine, providing wiki macros and act as a library/function provider for other Redmine plugins'
|
||||||
version '2.0.11'
|
version '2.0.12'
|
||||||
author_url 'https://alphanodes.com/'
|
author_url 'https://alphanodes.com/'
|
||||||
url 'https://github.com/alphanodes/additionals'
|
url 'https://github.com/alphanodes/additionals'
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ module Additionals
|
|||||||
end
|
end
|
||||||
|
|
||||||
def auto_assigned_to_user
|
def auto_assigned_to_user
|
||||||
manager_role = Role.builtin.find(Additionals.settings[:issue_auto_assign_role].to_i)
|
manager_role = Role.builtin.find_by(id: Additionals.settings[:issue_auto_assign_role])
|
||||||
groups = autoassign_get_group_list
|
groups = autoassign_get_group_list
|
||||||
return groups[manager_role].first.id unless groups.nil? || groups[manager_role].blank?
|
return groups[manager_role].first.id unless groups.nil? || groups[manager_role].blank?
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ module Additionals
|
|||||||
comment_id = info[:comment_id] if comment_id.nil?
|
comment_id = info[:comment_id] if comment_id.nil?
|
||||||
info[:issue_id])
|
info[:issue_id])
|
||||||
|
|
||||||
issue = Issue.find(issue_id)
|
issue = Issue.find_by(id: issue_id)
|
||||||
return 'N/A' if issue.nil? || !issue.visible?
|
return 'N/A' if issue.nil? || !issue.visible?
|
||||||
|
|
||||||
text = case options[:format]
|
text = case options[:format]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user