summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-02-18 20:20:17 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-02-18 20:20:17 +0000
commit4f2d74e25f00a70a1a424c2c574c125f43a64b0e (patch)
tree19f3a2461678b37de7fb742b8ec403c01f52defe /app/controllers
parentc9ed3fdae3828a3d2f1c3bd7309d52da5dafadad (diff)
downloadredmine-4f2d74e25f00a70a1a424c2c574c125f43a64b0e.tar.gz
redmine-4f2d74e25f00a70a1a424c2c574c125f43a64b0e.zip
fixed: error when clicking "add" with no block selected on my/page_layout
git-svn-id: http://redmine.rubyforge.org/svn/trunk@261 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/my_controller.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb
index f3d1b2a72..64a561f96 100644
--- a/app/controllers/my_controller.rb
+++ b/app/controllers/my_controller.rb
@@ -90,8 +90,9 @@ class MyController < ApplicationController
# The block is added on top of the page
# params[:block] : id of the block to add
def add_block
- @user = self.logged_in_user
block = params[:block]
+ render(:nothing => true) and return unless block && (BLOCKS.keys.include? block)
+ @user = self.logged_in_user
# remove if already present in a group
%w(top left right).each {|f| (session[:page_layout][f] ||= []).delete block }
# add it on top