on invalid proceed method in call to editSave, warn and recover rather than run time error
This commit is contained in:
parent
59ce3b3fd6
commit
9a45ff4b91
3 changed files with 37 additions and 3 deletions
|
|
@ -13,6 +13,8 @@
|
||||||
- fixed #12386: Story Manager - Carousel rendering broken in Story
|
- fixed #12386: Story Manager - Carousel rendering broken in Story
|
||||||
- fixed #12386: Story Manager - Carousel rendering broken in Story
|
- fixed #12386: Story Manager - Carousel rendering broken in Story
|
||||||
- fixed #12384: Click and drag reordering does not work in IE9
|
- fixed #12384: Click and drag reordering does not work in IE9
|
||||||
|
- fixed: MessageBoard tolerates Collaboration children not yet having a value for lastPostId
|
||||||
|
- on invalid proceed method in call to editSave, warn and recover rather than run time error
|
||||||
|
|
||||||
7.10.26
|
7.10.26
|
||||||
- fixed: Template diagnostics when called without a session asset.
|
- fixed: Template diagnostics when called without a session asset.
|
||||||
|
|
|
||||||
|
|
@ -3162,9 +3162,14 @@ sub www_editSave {
|
||||||
elsif ($proceed ne "") {
|
elsif ($proceed ne "") {
|
||||||
my $method = "www_".$session->form->process("proceed");
|
my $method = "www_".$session->form->process("proceed");
|
||||||
$session->asset($object);
|
$session->asset($object);
|
||||||
|
if( $session->asset->can($method) ) {
|
||||||
return $session->asset->$method();
|
return $session->asset->$method();
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
$session->log->warn("proceed method of $method specified but that method doesn't exist in " . ref($session->asset));
|
||||||
|
# else fall through to the default handling below
|
||||||
|
}
|
||||||
|
}
|
||||||
$session->asset($object->getContainer);
|
$session->asset($object->getContainer);
|
||||||
return $session->asset->www_view;
|
return $session->asset->www_view;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
warn "warning = $warning";
|
||||||
# WebGUI is Copyright 2001-2009 Plain Black Corporation.
|
# WebGUI is Copyright 2001-2009 Plain Black Corporation.
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
# Please read the legal notices (docs/legal.txt) and the license
|
# Please read the legal notices (docs/legal.txt) and the license
|
||||||
|
|
@ -172,7 +173,7 @@ sub definition {
|
||||||
|
|
||||||
package main;
|
package main;
|
||||||
|
|
||||||
plan tests => 138
|
plan tests => 140
|
||||||
+ scalar(@fixIdTests)
|
+ scalar(@fixIdTests)
|
||||||
+ scalar(@fixTitleTests)
|
+ scalar(@fixTitleTests)
|
||||||
+ 2*scalar(@getTitleTests) #same tests used for getTitle and getMenuTitle
|
+ 2*scalar(@getTitleTests) #same tests used for getTitle and getMenuTitle
|
||||||
|
|
@ -309,6 +310,23 @@ cmp_deeply(
|
||||||
[ "two", "three" ],
|
[ "two", "three" ],
|
||||||
"serialized property returns deserialized ref",
|
"serialized property returns deserialized ref",
|
||||||
);
|
);
|
||||||
|
|
||||||
|
do {
|
||||||
|
sleep 2; # so that we don't collide revisionDates
|
||||||
|
my $fatal_error;
|
||||||
|
my $warning;
|
||||||
|
local *WebGUI::Session::ErrorHandler::fatal = sub { my $self = shift; $fatal_error = shift; };
|
||||||
|
local *WebGUI::Session::ErrorHandler::warn = sub { my $self = shift; $warning = shift; };
|
||||||
|
local *WebGUI::Session::Form::validToken = sub { 1 };
|
||||||
|
my $html = WebGUI::Test->getPage($ta, "www_editSave", {
|
||||||
|
userId => 3,
|
||||||
|
formParams => { synopsis => '[ "two", "three" ]', proceed => 'asfd' },
|
||||||
|
});
|
||||||
|
ok ! $fatal_error, "no fatal error on invalid &proceed argument to www_editSave";
|
||||||
|
like $warning, qr/proceed method of www_asfd specified/, "warning about invalid proceed method generated";
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
$ta->purge;
|
$ta->purge;
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
|
|
@ -1235,3 +1253,12 @@ subtest 'canAdd tolerates being called as an object method', sub {
|
||||||
ok !$class->canAdd($session), 'Cannot add when called as a class method';
|
ok !$class->canAdd($session), 'Cannot add when called as a class method';
|
||||||
ok !$snip->canAdd($session), '...or an object method';
|
ok !$snip->canAdd($session), '...or an object method';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
################################################################
|
||||||
|
#
|
||||||
|
# www_editSave proceed parameter
|
||||||
|
#
|
||||||
|
################################################################
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue