fixing bugs resulting from new form package
This commit is contained in:
parent
6ae2995591
commit
9c3a4eb309
5 changed files with 37 additions and 78 deletions
|
|
@ -302,9 +302,7 @@ sub new {
|
|||
%raw = @_;
|
||||
}
|
||||
my %params;
|
||||
# Ensure that overrides overwrite the previously defined definition of a field
|
||||
my @reversedDefinitions = reverse @{$class->definition};
|
||||
foreach my $definition (@reversedDefinitions) {
|
||||
foreach my $definition (reverse @{$class->definition}) {
|
||||
foreach my $fieldName (keys %{$definition}) {
|
||||
my $value = $raw{$fieldName};
|
||||
# if we have no value, try the tagged name
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ sub definition {
|
|||
push(@{$definition}, {
|
||||
name=>{
|
||||
defaultValue=>"file"
|
||||
}
|
||||
},
|
||||
maxAttachments=>{
|
||||
defaultValue=>1
|
||||
}
|
||||
|
|
@ -100,7 +100,7 @@ sub getValueFromPost {
|
|||
my $self = shift;
|
||||
my $storage = WebGUI::Storage->create;
|
||||
$storage->addFileFromFormPost($self->{name});
|
||||
@files = $storage->getFiles;
|
||||
my @files = $storage->getFiles;
|
||||
if (scalar(@files) < 1) {
|
||||
$storage->delete;
|
||||
return undef;
|
||||
|
|
@ -130,7 +130,7 @@ sub toHtml {
|
|||
unless ($file eq "." || $file eq "..") {
|
||||
my $ext = $file;
|
||||
$ext =~ s/(.*?)\.gif/$1/;
|
||||
$uploadControl .= 'images["'.$ext.'"] = "'.$session{config}{extrasURL}.'/fileIcons/'.$file.'";'."\n";
|
||||
$uploadControl .= 'fileIcons["'.$ext.'"] = "'.$session{config}{extrasURL}.'/fileIcons/'.$file.'";'."\n";
|
||||
}
|
||||
}
|
||||
$uploadControl .= 'var uploader = new FileUploadControl("'.$self->{name}.'", fileIcons, "'.WebGUI::International::get('removeLabel','WebGUI').'","'.$self->{maxAttachments}.'");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue