fix [ 1328763 ] 6.7.3 FileAsset file size has incorrect value when displayed
This commit is contained in:
parent
7f1608a444
commit
fb5555e17c
2 changed files with 14 additions and 3 deletions
|
|
@ -45,6 +45,9 @@
|
||||||
- fix [ 1328105 ] Pages should contain "no-cache" tags
|
- fix [ 1328105 ] Pages should contain "no-cache" tags
|
||||||
- fix [ 1216810 ] anonymous registration errors persist
|
- fix [ 1216810 ] anonymous registration errors persist
|
||||||
- fix [ 1323272 ] Site modifications using GET in stead of POST
|
- fix [ 1323272 ] Site modifications using GET in stead of POST
|
||||||
|
- fix [ 1328763 ] 6.7.3 FileAsset file size has incorrect value when
|
||||||
|
displayed
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
6.7.6
|
6.7.6
|
||||||
|
|
|
||||||
|
|
@ -196,6 +196,7 @@ sub processPropertiesFromFormPost {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
$self->SUPER::processPropertiesFromFormPost;
|
$self->SUPER::processPropertiesFromFormPost;
|
||||||
my $storage = $self->getStorageLocation;
|
my $storage = $self->getStorageLocation;
|
||||||
|
delete $self->{_storageLocation};
|
||||||
my $filename = $storage->addFileFromFormPost("file");
|
my $filename = $storage->addFileFromFormPost("file");
|
||||||
if (defined $filename) {
|
if (defined $filename) {
|
||||||
my %data;
|
my %data;
|
||||||
|
|
@ -205,10 +206,7 @@ sub processPropertiesFromFormPost {
|
||||||
$data{menuTitle} = $filename unless ($session{form}{menuTitle});
|
$data{menuTitle} = $filename unless ($session{form}{menuTitle});
|
||||||
$data{url} = $self->getParent->get('url').'/'.$filename unless ($session{form}{url});
|
$data{url} = $self->getParent->get('url').'/'.$filename unless ($session{form}{url});
|
||||||
$self->update(\%data);
|
$self->update(\%data);
|
||||||
$self->setSize($storage->getFileSize($filename));
|
|
||||||
$self->{_storageLocation} = $storage;
|
|
||||||
}
|
}
|
||||||
$storage->setPrivileges($self->get("ownerUserId"), $self->get("groupIdView"), $self->get("groupIdEdit"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -232,6 +230,16 @@ sub purgeRevision {
|
||||||
return $self->SUPER::purgeRevision;
|
return $self->SUPER::purgeRevision;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
sub setSize {
|
||||||
|
my $self = shift;
|
||||||
|
my $fileSize = shift || 0;
|
||||||
|
my $storage = $self->getStorageLocation;
|
||||||
|
foreach my $file (@{$storage->getFiles}) {
|
||||||
|
$fileSize += $storage->getFileSize($file);
|
||||||
|
}
|
||||||
|
$self->SUPER::setSize($fileSize);
|
||||||
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue