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

Report information
The Basics
Id:
16235
Status:
resolved
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
perl-cpan [...] bereft.net
Cc:
AdminCc:

BugTracker
Severity:
(no value)
Broken in:
(no value)
Fixed in:
(no value)



Subject: Can't store false values in MIghtHave
This line in MightHave.pm: my $val = shift or return; # just fetching prevents a false or undef value from creating a might_have linked record. I tried to set a score to '0' but no record was created. Also @extra seems not to be used anymore (although if $meta->foreign_class can return () then I'm wrong) Patch forthcoming
--- Class-DBI-v3.0.12/t/14-might_have.t 2005-12-01 15:00:16.638877760 +0100 +++ Class-DBI-v3.0.12.orig/t/14-might_have.t 2005-12-01 14:31:11.622160624 +0100 @@ -3,7 +3,7 @@ BEGIN { eval "use DBD::SQLite"; - plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 21); + plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 18); } use lib 't/testlib'; @@ -61,16 +61,4 @@ } -Film->create_test_film; -{ - ok my $bt = Film->retrieve('Bad Taste'), "Get Film (recreated)"; - is $bt->blurb, undef, "Bad taste has no blurb"; - - $bt->blurb("0"); - $bt->update; - is $bt->blurb, "0", "We can write false values"; - - $bt->delete; -} -
[BOWMANBS - Thu Dec 1 09:10:14 2005]:
Show quoted text
> This line in MightHave.pm: > my $val = shift or return; # just fetching > prevents a false or undef value from creating a might_have linked > record. I tried to set a score to '0' but no record was created. > Patch forthcoming
If you can supply a patch for t/14-might_have, I should be able to fix this quite easily. If you can't then I'll get around to this eventually, but it might take a while. With a test patch I can get a fix out really quickly. Thanks, Tony
[bsb@bereft.net - Thu Dec 15 15:49:54 2005]:
Show quoted text
> > If you can supply a patch for t/14-might_have, I should be able to > > fix this quite easily.
> Thanks Tony. Patch against 3.0.12 attached.
You managed to get that in just in time for the new release! Applied - and extended to cope with explicit setting of undef/NULL as well. New version on its way to CPAN now. Thanks, Tony


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

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