Removed early return from printable name method
authorMatt Amos <zerebubuth@gmail.com>
Wed, 4 Apr 2012 15:58:28 +0000 (16:58 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 5 Apr 2012 12:53:41 +0000 (13:53 +0100)
app/helpers/browse_helper.rb

index 0b72040a3a6e80b70a659e2bebdd20cd03334e23..ffc638cdf491a6c7a22d57f420568f0ed173faa7 100644 (file)
@@ -13,14 +13,17 @@ module BrowseHelper
     if version
       name = t 'printable_name.with_version', :id => name, :version => object.version.to_s
     end
-    # stop here if redacted to avoid giving away redacted version tags.
-    return name if object.redacted?
 
-    if object.tags.include? "name:#{I18n.locale}"
-      name = t 'printable_name.with_name',  :name => object.tags["name:#{I18n.locale}"].to_s, :id => name
-    elsif object.tags.include? 'name'
-      name = t 'printable_name.with_name',  :name => object.tags['name'].to_s, :id => name
+    # don't look at object tags if redacted, so as to avoid giving 
+    # away redacted version tag information.
+    unless object.redacted?
+      if object.tags.include? "name:#{I18n.locale}"
+        name = t 'printable_name.with_name',  :name => object.tags["name:#{I18n.locale}"].to_s, :id => name
+      elsif object.tags.include? 'name'
+        name = t 'printable_name.with_name',  :name => object.tags['name'].to_s, :id => name
+      end
     end
+
     return name
   end