Bug#769699: unblock: libcgi-formbuilder-perl/3.09-2
Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock
Please unblock package libcgi-formbuilder-perl. This fixes #769240, a
regression introduced while fixing #766087 (use of dangerous/deprecated
API in CGI.pm, which causes warnings): some users of libcgi-formbuilder-perl
turn out to use it with an object that implements the deprecated part of the
CGI.pm interface, but not the replacement.
The source debdiff is hard to read because I combined three related
patches into one replacement patch, so the attached diff is between
the resulting patched trees for 3.09-1 and 3.09-2, excluding the patches
themselves. Please let me know if you'd prefer a different diff.
unblock libcgi-formbuilder-perl/3.09-2
Regards,
S
-- System Information:
Debian Release: jessie/sid
APT prefers proposed-updates
APT policy: (500, 'proposed-updates'), (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -ru '--exclude=.pc' '--exclude=*.patch' libcgi-formbuilder-perl-3.09-1/debian/changelog libcgi-formbuilder-perl-3.09-2/debian/changelog
--- libcgi-formbuilder-perl-3.09-1/debian/changelog 2014-10-25 01:04:40.000000000 +0100
+++ libcgi-formbuilder-perl-3.09-2/debian/changelog 2014-11-15 14:58:41.000000000 +0000
@@ -1,3 +1,12 @@
+libcgi-formbuilder-perl (3.09-2) unstable; urgency=medium
+
+ [ Simon McVittie ]
+ * Merge patches 0005-0006 into 0004, and adapt to retain support for
+ objects that mimic the CGI.pm API but do not have param_fetch.
+ Closes: bug#769240. Thanks to Simon McVittie.
+
+ -- Jonas Smedegaard <dr@jones.dk> Sat, 15 Nov 2014 15:58:40 +0100
+
libcgi-formbuilder-perl (3.09-1) unstable; urgency=medium
[ Salvatore Bonaccorso ]
diff -ru '--exclude=.pc' '--exclude=*.patch' libcgi-formbuilder-perl-3.09-1/debian/patches/series libcgi-formbuilder-perl-3.09-2/debian/patches/series
--- libcgi-formbuilder-perl-3.09-1/debian/patches/series 2014-10-25 00:58:09.000000000 +0100
+++ libcgi-formbuilder-perl-3.09-2/debian/patches/series 2014-11-15 14:50:04.000000000 +0000
@@ -1,6 +1,4 @@
pod-encoding.patch
pod-spelling.patch
0004-Avoid-unneeded-warning-from-CGI.pm-4.05-or-newer.patch
-0005-Avoid-unneeded-warning-from-CGI.pm-4.05-or-newer.patch
-0006-Fix-another-use-of-param-that-will-cause-a-warning-i.patch
0007-Comment-that-cgi_param-is-context-sensitive-just-lik.patch
diff -ru '--exclude=.pc' '--exclude=*.patch' libcgi-formbuilder-perl-3.09-1/lib/CGI/FormBuilder/Field.pm libcgi-formbuilder-perl-3.09-2/lib/CGI/FormBuilder/Field.pm
--- libcgi-formbuilder-perl-3.09-1/lib/CGI/FormBuilder/Field.pm 2014-11-15 16:41:38.000000000 +0000
+++ libcgi-formbuilder-perl-3.09-2/lib/CGI/FormBuilder/Field.pm 2014-11-15 16:41:48.000000000 +0000
@@ -189,7 +189,19 @@
my $self = shift;
debug 2, "$self->{name}: called \$field->cgi_value";
puke "Cannot set \$field->cgi_value manually" if @_;
- if (my @v = @{$self->{_form}{params}->param_fetch($self->name)}) {
+
+ my @v;
+ if ($self->{_form}{params}->can('param_fetch')) {
+ @v = @{$self->{_form}{params}->param_fetch($self->name)};
+ }
+ else {
+ # array-context calls to param($p) are deprecated in
+ # CGI.pm, but some other objects that mimic
+ # its interface don't have param_fetch
+ @v = $self->{_form}{params}->param($self->name);
+ }
+
+ if (@v) {
for my $v (@v) {
if ($self->other && $v eq $self->othername) {
debug 1, "$self->{name}: redoing value from _other field";
diff -ru '--exclude=.pc' '--exclude=*.patch' libcgi-formbuilder-perl-3.09-1/lib/CGI/FormBuilder/Multi.pm libcgi-formbuilder-perl-3.09-2/lib/CGI/FormBuilder/Multi.pm
--- libcgi-formbuilder-perl-3.09-1/lib/CGI/FormBuilder/Multi.pm 2014-11-15 16:41:38.000000000 +0000
+++ libcgi-formbuilder-perl-3.09-2/lib/CGI/FormBuilder/Multi.pm 2014-11-15 16:41:48.000000000 +0000
@@ -218,7 +218,19 @@
}
for my $k (@{$self->{keepextras}}) {
next if $k eq $pnam;
- for my $v (@{$self->{params}->param_fetch($k)}) {
+
+ my @values;
+ if ($self->{params}->can('param_fetch')) {
+ @values = @{$self->{params}->param_fetch($k)};
+ }
+ else {
+ # array-context calls to param($k) are deprecated in
+ # CGI.pm, but some other objects that mimic
+ # its interface don't have param_fetch
+ @values = $self->{params}->param($k);
+ }
+
+ for my $v (@values) {
push @keep, { name => $k, value => $v };
}
}
diff -ru '--exclude=.pc' '--exclude=*.patch' libcgi-formbuilder-perl-3.09-1/lib/CGI/FormBuilder.pm libcgi-formbuilder-perl-3.09-2/lib/CGI/FormBuilder.pm
--- libcgi-formbuilder-perl-3.09-1/lib/CGI/FormBuilder.pm 2014-11-15 16:41:38.000000000 +0000
+++ libcgi-formbuilder-perl-3.09-2/lib/CGI/FormBuilder.pm 2014-11-15 16:41:48.000000000 +0000
@@ -855,7 +855,18 @@
# Make sure to get all values
for my $p (@keep) {
- for my $v (@{$self->{params}->param_fetch($p)}) {
+ my @values;
+ if ($self->{params}->can('param_fetch')) {
+ @values = @{$self->{params}->param_fetch($p)};
+ }
+ else {
+ # array-context calls to param($p) are deprecated in
+ # CGI.pm, but some other objects that mimic
+ # its interface don't have param_fetch
+ @values = $self->{params}->param($p);
+ }
+
+ for my $v (@values) {
debug 1, "keepextras: saving hidden param $p = $v";
push @html, htmltag('input', name => $p, type => 'hidden', value => $v);
}
Reply to: