Fix a typo in Asset->checkView, which redirected assets in the clipboard to the trash instead. Fixes bug #11139.
This commit is contained in:
parent
a2a2bac440
commit
2250ab0452
3 changed files with 56 additions and 11 deletions
|
|
@ -21,6 +21,7 @@
|
||||||
- fixed #11128: Thing breaks w/ default value for date field
|
- fixed #11128: Thing breaks w/ default value for date field
|
||||||
- fixed #10888: Issues with adding points to Maps
|
- fixed #10888: Issues with adding points to Maps
|
||||||
- fixed #10993: Editor drops last letter if s
|
- fixed #10993: Editor drops last letter if s
|
||||||
|
- fixed #11139: referencing an item in the clipboard
|
||||||
|
|
||||||
7.8.1
|
7.8.1
|
||||||
- mark $session->datetime->time as deprecated and remove its use from core code
|
- mark $session->datetime->time as deprecated and remove its use from core code
|
||||||
|
|
|
||||||
|
|
@ -326,7 +326,7 @@ sub checkView {
|
||||||
return "chunked";
|
return "chunked";
|
||||||
}
|
}
|
||||||
elsif ($var->isAdminOn && $self->get("state") =~ /^clipboard/) { # show em clipboard
|
elsif ($var->isAdminOn && $self->get("state") =~ /^clipboard/) { # show em clipboard
|
||||||
my $queryFrag = "func=manageTrash";
|
my $queryFrag = "func=manageClipboard";
|
||||||
if ($self->session->form->process('revision')) {
|
if ($self->session->form->process('revision')) {
|
||||||
$queryFrag .= ";revision=".$self->session->form->process('revision');
|
$queryFrag .= ";revision=".$self->session->form->process('revision');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,15 +63,14 @@ $testGroups{'canEdit asset'} = WebGUI::Group->new($session, 'new');
|
||||||
$testUsers{'canEdit group user'} = WebGUI::User->new($session, 'new');
|
$testUsers{'canEdit group user'} = WebGUI::User->new($session, 'new');
|
||||||
$testUsers{'canEdit group user'}->addToGroups([$testGroups{'canEdit asset'}->getId]);
|
$testUsers{'canEdit group user'}->addToGroups([$testGroups{'canEdit asset'}->getId]);
|
||||||
$testUsers{'canEdit group user'}->username('Edit Group User');
|
$testUsers{'canEdit group user'}->username('Edit Group User');
|
||||||
WebGUI::Test->groupsToDelete($testGroups{'canEdit asset'});
|
addToCleanup($testGroups{'canEdit asset'});
|
||||||
|
|
||||||
##A group and user for groupIdEdit
|
##A group and user for groupIdEdit
|
||||||
$testGroups{'canAdd asset'} = WebGUI::Group->new($session, 'new');
|
$testGroups{'canAdd asset'} = WebGUI::Group->new($session, 'new');
|
||||||
$testUsers{'canAdd group user'} = WebGUI::User->new($session, 'new');
|
$testUsers{'canAdd group user'} = WebGUI::User->new($session, 'new');
|
||||||
$testUsers{'canAdd group user'}->addToGroups([$testGroups{'canAdd asset'}->getId]);
|
$testUsers{'canAdd group user'}->addToGroups([$testGroups{'canAdd asset'}->getId]);
|
||||||
$testUsers{'canEdit group user'}->username('Can Add Group User');
|
$testUsers{'canEdit group user'}->username('Can Add Group User');
|
||||||
WebGUI::Test->groupsToDelete($testGroups{'canAdd asset'});
|
addToCleanup($testGroups{'canAdd asset'}, values %testUsers);
|
||||||
WebGUI::Test->usersToDelete(values %testUsers);
|
|
||||||
|
|
||||||
my $canAddMaker = WebGUI::Test::Maker::Permission->new();
|
my $canAddMaker = WebGUI::Test::Maker::Permission->new();
|
||||||
$canAddMaker->prepare({
|
$canAddMaker->prepare({
|
||||||
|
|
@ -104,7 +103,7 @@ $properties = {
|
||||||
};
|
};
|
||||||
|
|
||||||
my $versionTag2 = WebGUI::VersionTag->getWorking($session);
|
my $versionTag2 = WebGUI::VersionTag->getWorking($session);
|
||||||
WebGUI::Test->tagsToRollback($versionTag2);
|
addToCleanup($versionTag2);
|
||||||
|
|
||||||
my $canEditAsset = $rootAsset->addChild($properties, $properties->{id});
|
my $canEditAsset = $rootAsset->addChild($properties, $properties->{id});
|
||||||
|
|
||||||
|
|
@ -120,7 +119,7 @@ $canEditMaker->prepare({
|
||||||
});
|
});
|
||||||
|
|
||||||
my $versionTag3 = WebGUI::VersionTag->getWorking($session);
|
my $versionTag3 = WebGUI::VersionTag->getWorking($session);
|
||||||
WebGUI::Test->tagsToRollback($versionTag3);
|
addToCleanup($versionTag3);
|
||||||
$properties = {
|
$properties = {
|
||||||
# '1234567890123456789012'
|
# '1234567890123456789012'
|
||||||
id => 'canViewAsset0000000010',
|
id => 'canViewAsset0000000010',
|
||||||
|
|
@ -153,7 +152,7 @@ $canViewMaker->prepare(
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
plan tests => 116
|
plan tests => 126
|
||||||
+ 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
|
||||||
|
|
@ -303,7 +302,7 @@ $session->{_request} = $origRequest;
|
||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
my $versionTag = WebGUI::VersionTag->getWorking($session);
|
my $versionTag = WebGUI::VersionTag->getWorking($session);
|
||||||
WebGUI::Test->tagsToRollback($versionTag);
|
addToCleanup($versionTag);
|
||||||
$versionTag->set({name=>"Asset tests"});
|
$versionTag->set({name=>"Asset tests"});
|
||||||
|
|
||||||
$properties = {
|
$properties = {
|
||||||
|
|
@ -744,7 +743,7 @@ $product3->purge;
|
||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
my $versionTag4 = WebGUI::VersionTag->getWorking($session);
|
my $versionTag4 = WebGUI::VersionTag->getWorking($session);
|
||||||
WebGUI::Test->tagsToRollback($versionTag4);
|
addToCleanup($versionTag4);
|
||||||
$versionTag4->set( { name => 'inheritUrlFromParent tests' } );
|
$versionTag4->set( { name => 'inheritUrlFromParent tests' } );
|
||||||
|
|
||||||
$properties = {
|
$properties = {
|
||||||
|
|
@ -890,7 +889,6 @@ $session->log->warn('parent asset is now committed');
|
||||||
is( $testVersionTag->get('isCommitted'), 1, 'parent asset is now committed' );
|
is( $testVersionTag->get('isCommitted'), 1, 'parent asset is now committed' );
|
||||||
|
|
||||||
$childVersionTag = WebGUI::VersionTag->new( $session, $childAsset->get('tagId') );
|
$childVersionTag = WebGUI::VersionTag->new( $session, $childAsset->get('tagId') );
|
||||||
$session->log->warn('child asset is now committed');
|
|
||||||
is( $childVersionTag->get('isCommitted'), 1, 'child asset is now committed' );
|
is( $childVersionTag->get('isCommitted'), 1, 'child asset is now committed' );
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
|
|
@ -901,12 +899,58 @@ is( $childVersionTag->get('isCommitted'), 1, 'child asset is now committed' );
|
||||||
|
|
||||||
my $assetToCommit = $defaultAsset->addChild({ className => 'WebGUI::Asset::Snippet', title => 'Snippet to commit and clone from db', });
|
my $assetToCommit = $defaultAsset->addChild({ className => 'WebGUI::Asset::Snippet', title => 'Snippet to commit and clone from db', });
|
||||||
my $cloneTag = WebGUI::VersionTag->getWorking($session);
|
my $cloneTag = WebGUI::VersionTag->getWorking($session);
|
||||||
WebGUI::Test->tagsToRollback($cloneTag);
|
addToCleanup($cloneTag);
|
||||||
$cloneTag->commit;
|
$cloneTag->commit;
|
||||||
is($assetToCommit->get('status'), 'pending', 'cloneFromDb: local asset is still pending');
|
is($assetToCommit->get('status'), 'pending', 'cloneFromDb: local asset is still pending');
|
||||||
$assetToCommit = $assetToCommit->cloneFromDb;
|
$assetToCommit = $assetToCommit->cloneFromDb;
|
||||||
is($assetToCommit->get('status'), 'approved', '... returns fresh, commited asset from the db');
|
is($assetToCommit->get('status'), 'approved', '... returns fresh, commited asset from the db');
|
||||||
|
|
||||||
|
################################################################
|
||||||
|
#
|
||||||
|
# checkView
|
||||||
|
#
|
||||||
|
################################################################
|
||||||
|
|
||||||
|
my $trashedAsset = $defaultAsset->addChild({
|
||||||
|
className => 'WebGUI::Asset::Snippet', title => 'Trashy',
|
||||||
|
});
|
||||||
|
|
||||||
|
my $clippedAsset = $defaultAsset->addChild({
|
||||||
|
className => 'WebGUI::Asset::Snippet', title => 'Clippy',
|
||||||
|
});
|
||||||
|
|
||||||
|
my $checkTag = WebGUI::VersionTag->getWorking($session);
|
||||||
|
$checkTag->commit;
|
||||||
|
addToCleanup($checkTag);
|
||||||
|
$trashedAsset = $trashedAsset->cloneFromDb;
|
||||||
|
$clippedAsset = $clippedAsset->cloneFromDb;
|
||||||
|
$trashedAsset->trash;
|
||||||
|
$clippedAsset->cut;
|
||||||
|
is $trashedAsset->get('state'), 'trash', 'checkView setup: trashed an asset';
|
||||||
|
is $clippedAsset->get('state'), 'clipboard', '... clipped an asset';
|
||||||
|
|
||||||
|
$session->var->switchAdminOff;
|
||||||
|
$session->http->setRedirectLocation('');
|
||||||
|
$session->http->setStatus(200, 'OK');
|
||||||
|
|
||||||
|
$trashedAsset->checkView();
|
||||||
|
is $session->http->getStatus, 410, '... status set to 410 for trashed asset';
|
||||||
|
is $session->http->getRedirectLocation, '', '... no redirect set';
|
||||||
|
|
||||||
|
$session->http->setStatus(200, 'OK');
|
||||||
|
$clippedAsset->checkView();
|
||||||
|
is $session->http->getStatus, 410, '... status set to 410 for cut asset';
|
||||||
|
is $session->http->getRedirectLocation, '', '... no redirect set';
|
||||||
|
|
||||||
|
$session->var->switchAdminOn;
|
||||||
|
$session->http->setStatus(200, 'OK');
|
||||||
|
is $trashedAsset->checkView(), 'chunked', '... returns "chunked" when admin is on for trashed asset';
|
||||||
|
is $session->http->getRedirectLocation, $trashedAsset->getUrl('func=manageTrash'), '... trashed asset sets redirect to manageTrash';
|
||||||
|
|
||||||
|
$session->http->setRedirectLocation('');
|
||||||
|
is $clippedAsset->checkView(), 'chunked', 'checkView: returns "chunked" when admin is on for cut asset';
|
||||||
|
is $session->http->getRedirectLocation, $clippedAsset->getUrl('func=manageClipboard'), '... cut asset sets redirect to manageClipboard';
|
||||||
|
|
||||||
##Return an array of hashrefs. Each hashref describes a test
|
##Return an array of hashrefs. Each hashref describes a test
|
||||||
##for the fixId method.
|
##for the fixId method.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue