Prevent dataform from caching when the form contains a captcha. Fixes bug #11049

This commit is contained in:
Colin Kuskie 2009-10-02 16:14:35 -07:00
parent 26f7dd8bca
commit 0e09072bc0
3 changed files with 34 additions and 3 deletions

View file

@ -27,6 +27,7 @@ use WebGUI::Asset::Wobject;
use WebGUI::Pluggable;
use WebGUI::DateTime;
use WebGUI::User;
use WebGUI::Utility;
use WebGUI::Group;
use WebGUI::AssetCollateral::DataForm::Entry;
use WebGUI::Form::SelectRichEditor;
@ -225,7 +226,8 @@ an entry is being viewed, bypass caching altogether.
sub getContentLastModified {
my $self = shift;
if ($self->currentView eq 'list' || $self->session->form->process('entryId')) {
my $hasCaptcha = isIn('Captcha', map { $_->{type} } map { $self->getFieldConfig($_) } @{ $self->getFieldOrder });
if ($self->currentView eq 'list' || $self->session->form->process('entryId') || $hasCaptcha) {
return time;
}
return $self->SUPER::getContentLastModified;
@ -1597,7 +1599,7 @@ sub www_editFieldSave {
$newSelf->createField($newName, \%field);
}
WebGUI::VersionTag->autoCommitWorkingIfEnabled($self->session);
WebGUI::VersionTag->autoCommitWorkingIfEnabled($session);
my $freshSelf = $newSelf->cloneFromDb();
if ($form->process("proceed") eq "editField") {
return $freshSelf->www_editField('new');