Never delete an asset property key.
This commit is contained in:
parent
49c2cfd5fa
commit
61b4e1e826
2 changed files with 11 additions and 10 deletions
|
|
@ -431,11 +431,11 @@ Sets the versioning lock to "on" so that this piece of content may not be edited
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub setVersionLock {
|
sub setVersionLock {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
$self->session->db->write("update asset set isLockedBy=? where assetId=?", [$self->session->user->userId, $self->getId]);
|
$self->session->db->write("update asset set isLockedBy=? where assetId=?", [$self->session->user->userId, $self->getId]);
|
||||||
$self->{_properties}{isLockedBy} = $self->session->user->userId;
|
$self->{_properties}{isLockedBy} = $self->session->user->userId;
|
||||||
$self->updateHistory("locked");
|
$self->updateHistory("locked");
|
||||||
$self->purgeCache;
|
$self->purgeCache;
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -484,11 +484,11 @@ Sets the versioning lock to "off" so that this piece of content may be edited on
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub unsetVersionLock {
|
sub unsetVersionLock {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
$self->session->db->write("update asset set isLockedBy=NULL where assetId=".$self->session->db->quote($self->getId));
|
$self->session->db->write("update asset set isLockedBy=NULL where assetId=".$self->session->db->quote($self->getId));
|
||||||
delete $self->{_properties}{isLockedBy};
|
$self->{_properties}{isLockedBy} = undef;
|
||||||
$self->updateHistory("unlocked");
|
$self->updateHistory("unlocked");
|
||||||
$self->purgeCache;
|
$self->purgeCache;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ use Test::More;
|
||||||
use Test::Deep;
|
use Test::Deep;
|
||||||
use Test::MockObject;
|
use Test::MockObject;
|
||||||
use HTML::TokeParser;
|
use HTML::TokeParser;
|
||||||
|
use Data::Dumper;
|
||||||
use Storable qw/dclone/;
|
use Storable qw/dclone/;
|
||||||
|
|
||||||
my $session = WebGUI::Test->session;
|
my $session = WebGUI::Test->session;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue