Skip Menu |
 

This queue is for tickets about the Class-DBI-AsForm CPAN distribution.

Report information
The Basics
Id: 20433
Status: open
Priority: 0/
Queue: Class-DBI-AsForm

People
Owner: Nobody in particular
Requestors: jaska.kivela [...] plenware.fi
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



CC: palvelinkeskus [...] plenware.fi
Subject: Class::DBI::AsForm, _to_select and null values
Date: Wed, 12 Jul 2006 20:26:03 +0300
To: bug-Class-DBI-AsForm [...] rt.cpan.org
From: Jaska Kivelä <jaska.kivela [...] plenware.fi>
Hello. We're using Class::DBI::AsForm to generate forms for a small application. There is a problem with 'non-Essential' fields and 'has-a' relationships: we would need a SELECT block with a null OPTION. Here's a diff (against 2.42), that does the trick: --clip-- *** AsForm.pm.orig 2006-07-12 20:19:29.000000000 +0300 --- AsForm.pm 2006-07-12 20:25:23.000000000 +0300 *************** *** 125,130 **** --- 125,133 ---- my $has_a_class = $hint || $self->__hasa_rels->{$col}->[0]; my @objs = $has_a_class->retrieve_all; my $a = HTML::Element->new("select", name => $col); + unless(grep {$_ eq $col} $self->_essential()) { + $a->push_content( new HTML::Element('option', value => '') ); + } for (@objs) { my $sel = HTML::Element->new("option", value => $_->id); $sel->attr("selected" => "selected") --clap-- -- Jaska Kivelä | Plenware Group Oy | gsm 040 576 2988 jaska.kivela@plenware.fi | Patamäenkatu 7 | fax 010 665 3060 asiantuntija | PL 13, 33201 TAMPERE |
Download signature.asc
application/pgp-signature 191b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #20433] Class::DBI::AsForm, _to_select and null values
Date: Sun, 16 Jul 2006 21:00:51 +0100
To: Jaska Kivel?? via RT <bug-Class-DBI-AsForm [...] rt.cpan.org>
From: Tony Bowden <tony [...] tmtm.com>
Download (untitled) / with headers
text/plain 254b
On Wed, Jul 12, 2006 at 01:27:32PM -0400, Jaska Kivel?? via RT wrote: Show quoted text
> we would need a SELECT block with a null OPTION. > Here's a diff (against 2.42), that does the trick:
This is likely to get applied much quicker with a test patch... Thanks, Tony


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.