Make version tags mandatory again.

This commit is contained in:
Colin Kuskie 2011-10-25 19:44:58 -07:00
parent d0b3be1749
commit 4bfabb9469
94 changed files with 405 additions and 489 deletions

View file

@ -98,11 +98,14 @@ property seatsAvailable => (
property startDate => (
noFormPost => 1,
fieldType => "dateTime",
default => '',
builder => '_default_startDate',
label => [ "add/edit event start date", 'Asset_EMSSubmission' ],
hoverHelp => [ "add/edit event start date help", 'Asset_EMSSubmission' ],
autoGenerate => 0,
);
sub _default_startDate {
return WebGUI::DateTime->new()->toMysql;
}
property duration => (
tab => "properties",
fieldType => "float",

View file

@ -123,7 +123,6 @@ sub addSubmission {
$newParams->{submissionId} = $self->ems->getNextSubmissionId;
my $newAsset = $self->addChild($newParams);
WebGUI::VersionTag->autoCommitWorkingIfEnabled($self->session, { override => 1, allowComments => 0 });
$self = $self->cloneFromDb;
return $newAsset;
}

View file

@ -344,7 +344,7 @@ sub disqualifyAsLastPost {
$thread->update({ lastPostId => $secondary_post->getId, lastPostDate => $secondary_post->get('creationDate'), });
}
else {
$thread->update({ lastPostId => '', lastPostDate => '', });
$thread->update({ lastPostId => '', lastPostDate => 0 });
}
}
my $cs = $thread->getParent;
@ -359,7 +359,7 @@ sub disqualifyAsLastPost {
$cs->update({ lastPostId => $secondary_post->getId, lastPostDate => $secondary_post->get('creationDate'), });
}
else {
$cs->update({ lastPostId => '', lastPostDate => '', });
$cs->update({ lastPostId => '', lastPostDate => 0 });
}
}
}

View file

@ -45,7 +45,7 @@ property lastPostId => (
property lastPostDate => (
noFormPost => 1,
fieldType => "dateTime",
default => undef,
default => 0,
);
property karma => (
noFormPost => 1,

View file

@ -620,13 +620,13 @@ sub www_createSubscriptionCodeBatch {
name => 'name',
label => $i18n->get('batch name'),
hoverHelp => $i18n->get('batch name description'),
value => $session->form->process('name'),
value => $session->form->process('name') || '',
);
$f->addField( "textarea",
name => 'description',
label => $i18n->get('batch description'),
hoverHelp => $i18n->get('batch description description'),
value => $session->form->process("description"),
value => $session->form->process("description") || '',
);
$f->addField( "submit", name => "send" );

View file

@ -1379,7 +1379,7 @@ around groupIdView => sub {
my $oldValue = $self->$orig;
my $return = $self->$orig(@_);
# Update the subscription group so if they can't see the collab, they don't get e-mailed
if ( $newValue && $newValue != $oldValue ) {
if ( $newValue && $newValue ne $oldValue ) {
my $instance_data = {
workflowId => 'xR-_GRRbjBojgLsFx3dEMA',
className => 'WebGUI::Asset',

View file

@ -121,6 +121,7 @@ use WebGUI::Asset::Wobject::Folder;
use WebGUI::Paginator;
use WebGUI::Keyword;
use WebGUI::Search;
use WebGUI::VersionTag;
use File::Path;
@ -302,7 +303,20 @@ sub getFolder {
my $folder = eval { WebGUI::Asset->newByUrl($session, $folderUrl); };
return $folder if !Exception::Class->caught();
##The requested folder doesn't exist. Make it.
##The requested folder doesn't exist. Make it and autocommit it.
##For a fully automatic commit, save the current tag, create a new one
##with the commit without approval workflow, commit it, then restore
##the original if it exists
my ($oldVersionTag, $newVersionTag);
$oldVersionTag = WebGUI::VersionTag->getWorking($session, 'noCreate');
if ($self->hasBeenCommitted) {
$newVersionTag = WebGUI::VersionTag->create($session, { workflowId => 'pbworkflow00000000003', });
$newVersionTag->setWorking;
$newVersionTag->set({ name => 'Adding folder '. $folderName. ' to archive '. $self->getUrl});
}
##Call SUPER because my addChild calls getFolder
$folder = $self->addChild({
@ -313,6 +327,9 @@ sub getFolder {
isHidden => 1,
styleTemplateId => $self->styleTemplateId,
});
$newVersionTag->commit() if $newVersionTag;
##Restore the old one, if it exists
$oldVersionTag->setWorking() if $oldVersionTag;
##Get a new version of the asset from the db with the correct state
$folder = $folder->cloneFromDb();