Skip to content

Commit 4bfabb9

Browse files
committedOct 26, 2011
Make version tags mandatory again.
1 parent d0b3be1 commit 4bfabb9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+405
-489
lines changed
 

‎docs/migration.txt

-9
Original file line numberDiff line numberDiff line change
@@ -281,15 +281,6 @@ processPropertiesFromFormPost
281281
-----------------------------
282282
Absurdly long and non-descriptive name, changed to processEditForm
283283

284-
Versioning
285-
----------
286-
New revisions are not created in a "pending" state automatically. VersionTags
287-
are not created by calling addRevision(). If you want a revision to be part of
288-
a version tag, you must set
289-
status => "pending",
290-
tagId => $tag->getId,
291-
explicitly.
292-
293284
Admin Controls
294285
--------------------
295286
The admin controls are now added to the asset with javascript. This javascript

‎lib/WebGUI/Asset.pm

+1-69
Original file line numberDiff line numberDiff line change
@@ -2776,40 +2776,12 @@ sub www_addSave {
27762776
return $self->session->style->userStyle($i18n->get("over max assets")) if ($self->session->config->get("maximumAssets") <= $count);
27772777
}
27782778

2779-
# Determine what version tag we should use
2780-
my $autoCommitId = $self->getAutoCommitWorkflowId();
2781-
2782-
my ($workingTag, $oldWorking);
2783-
if ( $autoCommitId ) {
2784-
$workingTag
2785-
= WebGUI::VersionTag->create( $session, {
2786-
groupToUse => '12', # Turn Admin On (for lack of something better)
2787-
workflowId => $autoCommitId,
2788-
} );
2789-
}
2790-
else {
2791-
my $parentAsset;
2792-
if ( not defined( $parentAsset = $self->getParent ) ) {
2793-
$parentAsset = WebGUI::Asset->newPending( $session, $self->parentId );
2794-
}
2795-
if ( $parentAsset->hasBeenCommitted ) {
2796-
$workingTag = WebGUI::VersionTag->getWorking( $session );
2797-
}
2798-
else {
2799-
$oldWorking = WebGUI::VersionTag->getWorking($session, 'noCreate');
2800-
$workingTag = WebGUI::VersionTag->new( $session, $parentAsset->tagId );
2801-
$workingTag->setWorking();
2802-
}
2803-
}
2804-
28052779
# Add the new asset
28062780
my $object;
28072781
my $className = $form->process('className','className') || $form->process('class','className');
28082782
$object = $self->addChild({
28092783
className => $className,
28102784
revisedBy => $session->user->userId,
2811-
tagId => $workingTag->getId,
2812-
status => "pending",
28132785
});
28142786
if ( !defined $object ) {
28152787
my $url = $session->url->page;
@@ -2819,11 +2791,6 @@ sub www_addSave {
28192791
$object->{_parent} = $self;
28202792
$object->url(undef);
28212793

2822-
# More version tag stuff
2823-
$object->setVersionLock;
2824-
$object->setAutoCommitTag($workingTag) if (defined $autoCommitId);
2825-
$oldWorking->setWorking if $oldWorking;
2826-
28272794
# Process properties from form post
28282795
my $errors = $object->processEditForm;
28292796
if (ref $errors eq 'ARRAY') {
@@ -2924,43 +2891,8 @@ sub www_editSave {
29242891
return $session->privilege->locked() unless $self->canEditIfLocked;
29252892
return $session->privilege->insufficient() unless $self->canEdit;
29262893

2927-
# Determine what version tag we should use
2928-
my $autoCommitId = $self->getAutoCommitWorkflowId();
2929-
2930-
my ($workingTag, $oldWorking);
2931-
if ( $autoCommitId ) {
2932-
$workingTag
2933-
= WebGUI::VersionTag->create( $session, {
2934-
groupToUse => '12', # Turn Admin On (for lack of something better)
2935-
workflowId => $autoCommitId,
2936-
} );
2937-
}
2938-
else {
2939-
my $parentAsset;
2940-
if ( not defined( $parentAsset = $self->getParent ) ) {
2941-
$parentAsset = WebGUI::Asset->newPending( $session, $self->parentId );
2942-
}
2943-
if ( $parentAsset->hasBeenCommitted ) {
2944-
$workingTag = WebGUI::VersionTag->getWorking( $session );
2945-
}
2946-
else {
2947-
$oldWorking = WebGUI::VersionTag->getWorking($session, 'noCreate');
2948-
$workingTag = WebGUI::VersionTag->new( $session, $parentAsset->tagId );
2949-
$workingTag->setWorking();
2950-
}
2951-
}
2952-
29532894
# Add the new revision
2954-
my $object = $self->addRevision({
2955-
revisedBy => $session->user->userId,
2956-
tagId => $workingTag->getId,
2957-
status => "pending",
2958-
});
2959-
2960-
# More version tag stuff
2961-
$object->setVersionLock;
2962-
$object->setAutoCommitTag($workingTag) if (defined $autoCommitId);
2963-
$oldWorking->setWorking if $oldWorking;
2895+
my $object = $self->addRevision();
29642896

29652897
# Process properties from form post
29662898
my $errors = $object->processEditForm;

0 commit comments

Comments
 (0)