fix for file uploading problems in File, Image, FilePile, Graphics (font) and FormHelper
This commit is contained in:
parent
6c8e840fe6
commit
ab6d0d2ce6
7 changed files with 28 additions and 6 deletions
|
|
@ -14,6 +14,7 @@
|
||||||
- fix: Calendars created with the 7.2.3-7.3.0 upgrade now have the same URL as
|
- fix: Calendars created with the 7.2.3-7.3.0 upgrade now have the same URL as
|
||||||
the Events Calendars they replace.
|
the Events Calendars they replace.
|
||||||
- fix: Events are created with no group information.
|
- fix: Events are created with no group information.
|
||||||
|
- fix: Can't add files with File Pile (perlDreamer Consulting, LLC)
|
||||||
|
|
||||||
7.3.9
|
7.3.9
|
||||||
- fix: SQL Form and big table imports
|
- fix: SQL Form and big table imports
|
||||||
|
|
|
||||||
|
|
@ -247,7 +247,11 @@ sub processPropertiesFromFormPost {
|
||||||
$self->SUPER::processPropertiesFromFormPost;
|
$self->SUPER::processPropertiesFromFormPost;
|
||||||
delete $self->{_storageLocation};
|
delete $self->{_storageLocation};
|
||||||
my $storage = $self->getStorageLocation;
|
my $storage = $self->getStorageLocation;
|
||||||
my $filename = $storage->addFileFromFormPost("file",1);
|
|
||||||
|
##The file form element adds a _file to each input name.
|
||||||
|
##This thing should really try to use the whole Form API, but that's a major
|
||||||
|
##change to this Asset
|
||||||
|
my $filename = $storage->addFileFromFormPost("file_file",1);
|
||||||
$storage->setPrivileges($self->get('ownerUserId'), $self->get('groupIdView'), $self->get('groupIdEdit'));
|
$storage->setPrivileges($self->get('ownerUserId'), $self->get('groupIdView'), $self->get('groupIdEdit'));
|
||||||
if (defined $filename && $filename ne $self->get("filename")) {
|
if (defined $filename && $filename ne $self->get("filename")) {
|
||||||
my %data;
|
my %data;
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,10 @@ sub edit {
|
||||||
sub editSave {
|
sub editSave {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $tempStorage = WebGUI::Storage->create($self->session);
|
my $tempStorage = WebGUI::Storage->create($self->session);
|
||||||
$tempStorage->addFileFromFormPost("file");
|
|
||||||
|
##This is a hack. File uploads should go through the WebGUI::Form::File API
|
||||||
|
$tempStorage->addFileFromFormPost("file_file");
|
||||||
|
|
||||||
foreach my $filename (@{$tempStorage->getFiles}) {
|
foreach my $filename (@{$tempStorage->getFiles}) {
|
||||||
my $storage = WebGUI::Storage::Image->create($self->session);
|
my $storage = WebGUI::Storage::Image->create($self->session);
|
||||||
$storage->addFileFromFilesystem($tempStorage->getPath($filename));
|
$storage->addFileFromFilesystem($tempStorage->getPath($filename));
|
||||||
|
|
|
||||||
|
|
@ -697,7 +697,11 @@ sub www_editListingSave {
|
||||||
$storage = WebGUI::Storage::Image->create($self->session);
|
$storage = WebGUI::Storage::Image->create($self->session);
|
||||||
$data{storageId} = $storage->getId;
|
$data{storageId} = $storage->getId;
|
||||||
}
|
}
|
||||||
my $screenshot = $storage->addFileFromFormPost("screenshot");
|
|
||||||
|
##This is a hack. File upload should go throught the WebGUI::Form::File API
|
||||||
|
##so that future changes don't affect us like this
|
||||||
|
my $screenshot = $storage->addFileFromFormPost("screenshot_file");
|
||||||
|
|
||||||
if (defined $screenshot) {
|
if (defined $screenshot) {
|
||||||
$data{filename} = $screenshot;
|
$data{filename} = $screenshot;
|
||||||
$storage->generateThumbnail($screenshot);
|
$storage->generateThumbnail($screenshot);
|
||||||
|
|
|
||||||
|
|
@ -255,7 +255,11 @@ sub www_importPackage {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
return $self->session->privilege->insufficient() unless ($self->canEdit && $self->session->user->isInGroup(4));
|
return $self->session->privilege->insufficient() unless ($self->canEdit && $self->session->user->isInGroup(4));
|
||||||
my $storage = WebGUI::Storage->createTemp($self->session);
|
my $storage = WebGUI::Storage->createTemp($self->session);
|
||||||
$storage->addFileFromFormPost("packageFile",1);
|
|
||||||
|
##This is a hack. It should use the WebGUI::Form::File API to insulate
|
||||||
|
##us from future form name changes.
|
||||||
|
$storage->addFileFromFormPost("packageFile_file",1);
|
||||||
|
|
||||||
my $error = "";
|
my $error = "";
|
||||||
if ($storage->getFileExtension($storage->getFiles->[0]) eq "wgpkg") {
|
if ($storage->getFileExtension($storage->getFiles->[0]) eq "wgpkg") {
|
||||||
$error = $self->importPackage($storage);
|
$error = $self->importPackage($storage);
|
||||||
|
|
|
||||||
|
|
@ -461,7 +461,9 @@ sub www_richEditAddImageSave {
|
||||||
return $session->privilege->insufficient('bare') unless $base->canEdit;
|
return $session->privilege->insufficient('bare') unless $base->canEdit;
|
||||||
|
|
||||||
my $storage = WebGUI::Storage::Image->create($session);
|
my $storage = WebGUI::Storage::Image->create($session);
|
||||||
my $filename = $storage->addFileFromFormPost('filename');
|
##This is a hack. It should use the WebGUI::Form::File API to insulate
|
||||||
|
##us from future form name changes.
|
||||||
|
my $filename = $storage->addFileFromFormPost('filename_file');
|
||||||
if ($filename) {
|
if ($filename) {
|
||||||
$base->addChild({
|
$base->addChild({
|
||||||
assetId => 'new',
|
assetId => 'new',
|
||||||
|
|
|
||||||
|
|
@ -261,7 +261,11 @@ sub www_editFontSave {
|
||||||
|
|
||||||
if ($session->form->process('fid') eq 'new') {
|
if ($session->form->process('fid') eq 'new') {
|
||||||
my $storage = WebGUI::Storage->create($session, 'new');
|
my $storage = WebGUI::Storage->create($session, 'new');
|
||||||
my $filename = $storage->addFileFromFormPost('fontFile');
|
|
||||||
|
##This is a hack. It should use the WebGUI::Form::File API to insulate
|
||||||
|
##us from future form name changes.
|
||||||
|
my $filename = $storage->addFileFromFormPost('fontFile_file');
|
||||||
|
|
||||||
if ($filename) {
|
if ($filename) {
|
||||||
my $font = WebGUI::Image::Font->new($session, 'new');
|
my $font = WebGUI::Image::Font->new($session, 'new');
|
||||||
$font->setName($session->form->process('fontName'));
|
$font->setName($session->form->process('fontName'));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue