check if "page"-instance variable is a WikiPage

* if not checked the use of the instance variable "page"
can lead to errors
* fixes bug when used with meetings plugin
pull/41/head
Romano Licker 12 years ago committed by Jens Ulferts
parent 69df1a789d
commit 1533e888f0
  1. 2
      lib/redmine/menu_manager/menu_helper.rb

@ -185,7 +185,7 @@ module Redmine::MenuManager::MenuHelper
end end
caption = item.caption(project) caption = item.caption(project)
if @page and !@page.new_record? and current_menu_item == :wiki if @page and @page.instance_of?(WikiPage) and !@page.new_record? and current_menu_item == :wiki
selected = node.name.to_sym == @page.title.dasherize.to_sym if @page.title selected = node.name.to_sym == @page.title.dasherize.to_sym if @page.title
elsif current_menu_item == :wiki and related_page = params[:id] elsif current_menu_item == :wiki and related_page = params[:id]
selected = related_page.dasherize == item.name.to_s.dasherize selected = related_page.dasherize == item.name.to_s.dasherize

Loading…
Cancel
Save