Fix some broken Form fields. Fixes bug #11611

This commit is contained in:
Colin Kuskie 2010-06-06 22:29:52 -07:00
parent 8d85912da7
commit d81a28b235
6 changed files with 58 additions and 1 deletions

View file

@ -4,6 +4,7 @@
- fixed #11613: Thingy: If next action after add is to add more things, previous data remains
- added API method commitAsUser allowing developers to commit version tags as other users
- fixed: The template form plugin would return an empty string when getValueAsHtml was called. ( Martin Kamerbeek / Oqapi )
- fixed #11611: Thingy: The add field pop up box has multiple "Text" field types
7.9.6
- new checkbox in the asset manager for clearing the package flag on import

View file

@ -125,7 +125,9 @@ sub getTypes {
}
my %fields = ();
foreach my $type (@types) {
$fields{$type} = WebGUI::Pluggable::instanciate('WebGUI::Form::'.ucfirst($type), 'getName', [$self->session]);
my $name = WebGUI::Pluggable::instanciate('WebGUI::Form::'.ucfirst($type), 'getName', [$self->session]);
$self->session->log->warn("type: $type; name: $name");
$fields{$type} = $name;
}
return \%fields;
}

View file

@ -36,6 +36,31 @@ The following methods are specifically available from this class. Check the supe
=cut
#-------------------------------------------------------------------
=head2 getName ( session )
Returns the human readable name of this control.
=cut
sub getName {
my ($self, $session) = @_;
return WebGUI::International->new($session, 'WebGUI')->get('user');
}
#-------------------------------------------------------------------
=head2 isDynamicCompatible ( )
Since this Form field requires a thingId to work it is not dynamic compatible.
=cut
sub isDynamicCompatible {
return 0;
}
#----------------------------------------------------------------------------
=head2 www_getThingFields ($session)

View file

@ -58,6 +58,19 @@ Defaults to the setting textBoxSize or 30 if that's not set. Specifies how big o
#-------------------------------------------------------------------
=head2 getName ( session )
Returns the human readable name of this control.
=cut
sub getName {
my ($self, $session) = @_;
return WebGUI::International->new($session, 'Form_Username')->get('username');
}
#-------------------------------------------------------------------
=head2 getValue ( [ value ] )
Retrieves a value from a form GET or POST and returns it. If the value comes back as undef, this method will return the defaultValue instead. Strip newlines/carriage returns from the value.

View file

@ -0,0 +1,11 @@
package WebGUI::i18n::English::Form_ThingsFieldList;
use strict;
our $I18N = {
'Thingy Fields List' => {
message => q|Thingy Fields List|,
lastUpdated => 1217216725,
},
};
1;

View file

@ -6,6 +6,11 @@ our $I18N = {
message => q|Sorry, that account name is already in use by another member of this site.|,
lastUpdated => 1217216725
},
'username' => {
message => q|Username|,
lastUpdated => 1217216725,
context => q|Name of the form plugin|,
},
};
1;