OSDN Git Service

fixed: error when clicking "add" with no block selected on my/page_layout
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 18 Feb 2007 20:20:17 +0000 (20:20 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 18 Feb 2007 20:20:17 +0000 (20:20 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@261 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/my_controller.rb
doc/CHANGELOG

index f3d1b2a..64a561f 100644 (file)
@@ -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
index 89a3c5c..c93a87c 100644 (file)
@@ -5,7 +5,12 @@ Copyright (C) 2006-2007  Jean-Philippe Lang
 http://redmine.rubyforge.org/\r
 \r
 \r
-== 02/18/2006 v0.4.2\r
+== xx/xx/2007 v0.4.3\r
+\r
+* fixed: error when clicking "add" with no block selected on my/page_layout\r
+\r
+\r
+== 02/18/2007 v0.4.2\r
 \r
 * Rails 1.2 is now required\r
 * settings are now stored in the database and editable through the application in: Admin -> Settings (config_custom.rb is no longer used)\r
@@ -33,12 +38,12 @@ http://redmine.rubyforge.org/
 * fixed: crash when a new user try to edit its "my page" layout\r
 \r
 \r
-== 01/03/2006 v0.4.1\r
+== 01/03/2007 v0.4.1\r
 \r
 * fixed: emails have no recipient when one of the project members has notifications disabled\r
 \r
 \r
-== 01/02/2006 v0.4.0\r
+== 01/02/2007 v0.4.0\r
 \r
 * simple SVN browser added (just needs svn binaries in PATH)\r
 * comments can now be added on news\r