Skip Menu |
 

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

Report information
The Basics
Id: 13303
Status: new
Priority: 0/
Queue: Class-DBI

People
Owner: Nobody in particular
Requestors: azb987654321 [...] hotmail.com
Cc:
AdminCc:

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



To: cdbi-talk [...] groups.kasei.com
From: azb987654321 [...] hotmail.com
Subject: Bug.
Date: Wed, 3 Sep 2003 15:31:59 +0100 (BST)
Download (untitled) / with headers
text/plain 895b
There appears to be a bug in the handling of triggers: Create a Class::DBI object containing a field 'foo' with a 'before_set' trigger which disallows null values, and a field 'bar' without any triggers. create() the object, setting both fields to valid values. update() and dbi_commit(). Now, retrieve() the object, and set() only the field without a trigger ('bar'). The before_set_foo trigger gets called during the set() call, and fails becuase the value of 'foo' passed to the trigger is null - i.e. the $self->validate_column_values() call in set() does not take into account the current values that were retrieved from the database, only the values which were passed to the set call. DWIM would suggest the ability to do: my $o = O->retrieve($id); $o->set(bar => 'new value'); to change only the value of bar (not foo). But this doesn't appear to be allowed by the current code.


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.