Skip to content

Commit

Permalink
Item13377: remove use Data::Dump
Browse files Browse the repository at this point in the history
... only used for debugging. also: fixed use of param() in list context
  • Loading branch information
MichaelDaum committed Jul 17, 2015
1 parent 92f744d commit bd1bdbe
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions data/System/FlexFormPlugin.txt
Expand Up @@ -187,6 +187,7 @@ Note that the actual results may vary depending on the formfield type of the !Da
| Release: | %$RELEASE% |
| Version: | %$VERSION% |
| Change History: | <!-- versions below in reverse order -->&nbsp; |
| 17 Jul 2015: | fixed use of =param()= in list context |
| 24 Mar 2015: | working around encoding problems with CGI >= 4.11 |
| 12 Mar 2015: | restructured code to offer a proper perl api |
| 16 Dec 2014: | added =$defaultvalue= variable; \
Expand Down
2 changes: 1 addition & 1 deletion lib/Foswiki/Plugins/FlexFormPlugin.pm
Expand Up @@ -18,7 +18,7 @@ package Foswiki::Plugins::FlexFormPlugin;
use strict;
use warnings;

our $VERSION = '5.00';
our $VERSION = '5.10';
our $RELEASE = '24 Mar 2015';
our $SHORTDESCRIPTION = 'Flexible way to render <nop>DataForms';
our $NO_PREFS_IN_TOPIC = 1;
Expand Down
2 changes: 1 addition & 1 deletion lib/Foswiki/Plugins/FlexFormPlugin/Base.pm
Expand Up @@ -20,7 +20,7 @@ use warnings;

use Foswiki::Func();
use Foswiki::Form();
use Data::Dump qw(dump);
#use Data::Dump qw(dump);

use constant TRACE => 0; # toggle me
our %topicObjs = (); # shared among all classes
Expand Down
9 changes: 5 additions & 4 deletions lib/Foswiki/Plugins/FlexFormPlugin/RenderForEdit.pm
Expand Up @@ -22,8 +22,6 @@ use Foswiki::Func();
use Foswiki::Form();
use Foswiki::OopsException();
use Error qw( :try );
use Encode ();
use CGI();

use Foswiki::Plugins::FlexFormPlugin::Base();
our @ISA = qw( Foswiki::Plugins::FlexFormPlugin::Base );
Expand Down Expand Up @@ -232,7 +230,10 @@ sub handle {

unless (defined $fieldValue) {
my $query = Foswiki::Func::getCgiQuery();
$fieldValue = $query->param($fieldName);
if (defined $query->param($fieldName)) {
$fieldValue = join(", ", grep {!/^$/} $query->multi_param($fieldName));
#print STDERR "fieldValue=$fieldValue\n";
}
}

unless (defined $fieldValue) {
Expand All @@ -258,7 +259,7 @@ sub handle {

$fieldEdit = $this->{session}{plugins}->dispatch('renderFormFieldForEditHandler', $fieldName, $fieldType, $fieldSize, $fieldValue, $fieldAttrs, $fieldAllowedValues);

my $isHidden = ($theHidden && $fieldName =~ /^($theHidden)$/) ? 1 : 0;
my $isHidden = ($fieldAttrs=~ /h/i || $theHidden && $fieldName =~ /^($theHidden)$/) ? 1 : 0;
unless ($fieldEdit) {
if ($isHidden) {
# sneak in the value into the topicObj
Expand Down

0 comments on commit bd1bdbe

Please sign in to comment.