]> source.dussan.org Git - redmine.git/commitdiff
rescued to_date exception when displaying a custom value
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 4 Feb 2007 16:35:42 +0000 (16:35 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 4 Feb 2007 16:35:42 +0000 (16:35 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@237 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/custom_fields_helper.rb

index e473ccdbe2b993817a969016457a2e86389e9da1..6a596b89b65001b2c948571abf0a01397646efaf 100644 (file)
@@ -59,10 +59,10 @@ module CustomFieldsHelper
   \r
   # Return a string used to display a custom value\r
   def format_value(value, field_format)\r
-    return "" unless value\r
+    return "" unless value && !value.empty?\r
     case field_format\r
     when "date"\r
-      value.empty? ? "" : l_date(value.to_date)\r
+      begin; l_date(value.to_date); rescue; value end\r
     when "bool"\r
       l_YesNo(value == "1")\r
     else\r