diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index 82f1818e6..413e8e1f6 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -127,7 +127,7 @@ property ownerUserId => ( uiLevel => 6, fieldType => 'user', default => '3', - trigger => \&_set_ownerUserId, + trigger => sub { shift->_set_ownerUserId(@_) } , ); sub _set_ownerUserId { return; @@ -139,7 +139,7 @@ property groupIdView => ( uiLevel => 6, fieldType => 'group', default => '7', - trigger => \&_set_groupIdView, + trigger => sub { shift->_set_groupIdView(@_) }, ); sub _set_groupIdView { return; @@ -152,7 +152,7 @@ property groupIdEdit => ( uiLevel => 6, fieldType => 'group', default => '4', - trigger => \&_set_groupIdEdit, + trigger => sub { shift->_set_groupIdEdit(@_) } , ); sub _set_groupIdEdit { return; diff --git a/lib/WebGUI/Role/Asset/SetStoragePermissions.pm b/lib/WebGUI/Role/Asset/SetStoragePermissions.pm index 417a0cd25..fdcf3ebcb 100644 --- a/lib/WebGUI/Role/Asset/SetStoragePermissions.pm +++ b/lib/WebGUI/Role/Asset/SetStoragePermissions.pm @@ -33,6 +33,7 @@ use Moose::Role; sub _set_ownerUserId { my ($self, $new, $old) = @_; + $old ||= ''; if ($new ne $old) { $self->getStorageLocation->setPrivileges($self->ownerUserId, $self->groupIdView, $self->groupIdEdit); } @@ -40,6 +41,7 @@ sub _set_ownerUserId { sub _set_groupIdView { my ($self, $new, $old) = @_; + $old ||= ''; if ($new ne $old) { $self->getStorageLocation->setPrivileges($self->ownerUserId, $self->groupIdView, $self->groupIdEdit); } @@ -47,6 +49,7 @@ sub _set_groupIdView { sub _set_groupIdEdit { my ($self, $new, $old) = @_; + $old ||= ''; if ($new ne $old) { $self->getStorageLocation->setPrivileges($self->ownerUserId, $self->groupIdView, $self->groupIdEdit); } diff --git a/t/Asset/File.t b/t/Asset/File.t index 0d1a8ff02..0647906fa 100644 --- a/t/Asset/File.t +++ b/t/Asset/File.t @@ -125,7 +125,6 @@ cmp_deeply( my $newRev = $asset->addRevision( { groupIdView => '7' }, time + 8 ); WebGUI::Test::addToCleanup( WebGUI::VersionTag->getWorking( $session ) ); is( $newRev->getStorageLocation->getFileContentsAsScalar('.wgaccess'), undef, "wgaccess doesn't exist" ); -note( @{ $newRev->getStorageLocation->getFiles() } ); ############################################ #