diff --git a/lib/WebGUI/AssetVersioning.pm b/lib/WebGUI/AssetVersioning.pm index 6f9383310..40d8efa00 100644 --- a/lib/WebGUI/AssetVersioning.pm +++ b/lib/WebGUI/AssetVersioning.pm @@ -431,11 +431,11 @@ Sets the versioning lock to "on" so that this piece of content may not be edited =cut sub setVersionLock { - my $self = shift; - $self->session->db->write("update asset set isLockedBy=? where assetId=?", [$self->session->user->userId, $self->getId]); - $self->{_properties}{isLockedBy} = $self->session->user->userId; - $self->updateHistory("locked"); - $self->purgeCache; + my $self = shift; + $self->session->db->write("update asset set isLockedBy=? where assetId=?", [$self->session->user->userId, $self->getId]); + $self->{_properties}{isLockedBy} = $self->session->user->userId; + $self->updateHistory("locked"); + $self->purgeCache; } #------------------------------------------------------------------- @@ -484,11 +484,11 @@ Sets the versioning lock to "off" so that this piece of content may be edited on =cut sub unsetVersionLock { - my $self = shift; - $self->session->db->write("update asset set isLockedBy=NULL where assetId=".$self->session->db->quote($self->getId)); - delete $self->{_properties}{isLockedBy}; - $self->updateHistory("unlocked"); - $self->purgeCache; + my $self = shift; + $self->session->db->write("update asset set isLockedBy=NULL where assetId=".$self->session->db->quote($self->getId)); + $self->{_properties}{isLockedBy} = undef; + $self->updateHistory("unlocked"); + $self->purgeCache; } diff --git a/t/Asset/Asset.t b/t/Asset/Asset.t index 504f860eb..dcd5fff62 100644 --- a/t/Asset/Asset.t +++ b/t/Asset/Asset.t @@ -28,6 +28,7 @@ use Test::More; use Test::Deep; use Test::MockObject; use HTML::TokeParser; +use Data::Dumper; use Storable qw/dclone/; my $session = WebGUI::Test->session;