after upgrade 1.5.1 -> 1.5.2. 'top level based search' results in http:500 when 'Documents' is included #408

This commit is contained in:
Karel Pičman 2015-07-20 09:53:34 +02:00
parent 58e6069255
commit 8a0426b57c

View File

@ -88,11 +88,13 @@ class DmsfFile < ActiveRecord::Base
Redmine::Search.cache_store.delete("DmsfFile-#{o.id}")
else
desc = o.description
desc += " / #{o.last_revision.comment}" if o.last_revision.comment.present?
desc += ' / ' if o.description.present? && o.last_revision.comment.present?
desc += o.last_revision.comment if o.last_revision.comment.present?
end
else
desc = o.description
desc += " / #{o.last_revision.comment}" if o.last_revision.comment.present?
desc += ' / ' if o.description.present? && o.last_revision.comment.present?
desc += o.last_revision.comment if o.last_revision.comment.present?
end
desc
},
@ -400,7 +402,7 @@ class DmsfFile < ActiveRecord::Base
Redmine::Search.cache_store.write("DmsfFile-#{dmsf_file.id}",
dochash['sample'].force_encoding('UTF-8')) if dochash['sample']
else
dmsf_file.event_description = dochash['sample'].force_encoding('UTF-8') if dochash['sample']
dmsf_file.description = dochash['sample'].force_encoding('UTF-8') if dochash['sample']
end
break if(!options[:limit].blank? && results.count >= options[:limit])
results << dmsf_file