Forward port of isHidden work from 7.3 for Post, Event and WikiPage.

isHidden is not allowed to be 0 for those Assets.  I had to reinstantiate
the update method for the Event Asset, but I only put in the code to
force isHidden to be forced to 1.
This commit is contained in:
Colin Kuskie 2007-06-26 04:33:07 +00:00
parent 7abd54eb94
commit 0c45e5286e
4 changed files with 45 additions and 21 deletions

View file

@ -79,7 +79,6 @@ sub addRevision {
delete $newSelf->{_thread};
}
$newSelf->update({
isHidden => 1,
dateUpdated=>$now,
});
@ -1037,19 +1036,21 @@ We overload the update method from WebGUI::Asset in order to handle file system
=cut
sub update {
my $self = shift;
my %before = (
owner => $self->get("ownerUserId"),
view => $self->get("groupIdView"),
edit => $self->get("groupIdEdit")
);
$self->SUPER::update(@_);
if ($self->get("ownerUserId") ne $before{owner} || $self->get("groupIdEdit") ne $before{edit} || $self->get("groupIdView") ne $before{view}) {
my $storage = $self->getStorageLocation;
if (-d $storage->getPath) {
$storage->setPrivileges($self->get("ownerUserId"),$self->get("groupIdView"),$self->get("groupIdEdit"));
}
my $self = shift;
my $properties = shift;
my %before = (
owner => $self->get("ownerUserId"),
view => $self->get("groupIdView"),
edit => $self->get("groupIdEdit")
);
$properties->{isHidden} = 1;
$self->SUPER::update($properties, @_);
if ($self->get("ownerUserId") ne $before{owner} || $self->get("groupIdEdit") ne $before{edit} || $self->get("groupIdView") ne $before{view}) {
my $storage = $self->getStorageLocation;
if (-d $storage->getPath) {
$storage->setPrivileges($self->get("ownerUserId"),$self->get("groupIdView"),$self->get("groupIdEdit"));
}
}
}
#-------------------------------------------------------------------