mlantahler:Bugfix: Small bugfix to prevent the usage of uninitialized $funcName. Happens if the form is submitted by pressing <enter> instead of pressing the button (at least in IE7). (merged from branches/gsoc)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@41779 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2007-09-14 18:02:03 +00:00
parent d47e6cf67c
commit 4ae8c85d46

View File

@ -76,6 +76,7 @@ class Controller extends ViewableData {
}
// Look at the action variables for forms
$funcName = null;
foreach($this->requestParams as $paramName => $paramVal) {
if(substr($paramName,0,7) == 'action_') {
// Cleanup action_, _x and _y from image fields
@ -155,6 +156,7 @@ class Controller extends ViewableData {
user_error("No action button has been clicked in this form executon, and no default has been allowed", E_USER_ERROR);
}
// First, try a handler method on the controller
if($this->hasMethod($funcName) || !$form) {
if(isset($_GET['debug_controller'])){