summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-07-13 13:25:37 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-07-13 13:25:37 +0000
commit937cee726905330807f1a97807749f1fc474d45d (patch)
treeb73c29c185cde3fa839060cff5045d0bda0ce39c /lib
parentad497bdcbabbd1a3863846ff7a0cded369593f04 (diff)
downloadredmine-937cee726905330807f1a97807749f1fc474d45d.tar.gz
redmine-937cee726905330807f1a97807749f1fc474d45d.zip
Prevent blank menu caption.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1663 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/menu_manager.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/redmine/menu_manager.rb b/lib/redmine/menu_manager.rb
index 11b7a72e8..a3dc3ca25 100644
--- a/lib/redmine/menu_manager.rb
+++ b/lib/redmine/menu_manager.rb
@@ -167,7 +167,9 @@ module Redmine
def caption(project=nil)
if @caption.is_a?(Proc)
- @caption.call(project)
+ c = @caption.call(project).to_s
+ c = @name.to_s.humanize if c.blank?
+ c
else
# check if localized string exists on first render (after GLoc strings are loaded)
@caption_key ||= (@caption || (l_has_string?("label_#{@name}".to_sym) ? "label_#{@name}".to_sym : @name.to_s.humanize))