From 8a0426b57cb98e8c4c40a8faf7432a40685a7897 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Pi=C4=8Dman?= Date: Mon, 20 Jul 2015 09:53:34 +0200 Subject: [PATCH] after upgrade 1.5.1 -> 1.5.2. 'top level based search' results in http:500 when 'Documents' is included #408 --- app/models/dmsf_file.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/models/dmsf_file.rb b/app/models/dmsf_file.rb index 8dda5756..6280e0e9 100644 --- a/app/models/dmsf_file.rb +++ b/app/models/dmsf_file.rb @@ -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