Skip Menu |

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

Report information
The Basics
Id: 25344
Status: open
Priority: 0/
Queue: Class-Trigger

People
Owner: Nobody in particular
Requestors: finlay [...] scoop.co.nz
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.11
Fixed in: 0.10



Subject: Breaking existing Class::DBI code
Hi There After upgrading from 0.10 to 0.11 some of our existing code started dieing with the following error. The call that started the crash was ->create on an object with a trigger defined. Actually it is a cascade of triggers.. object1 has trigger on update that creates object2 object2 has trigger on create. We have held back this module in our production environment for the time being. [error] __triggers is not a column of NewsAgent::Block::History at /usr/local/lib/perl5/site_perl/5.8.6/Class/Trigger.pm line 41 Stack: [/usr/local/lib/perl5/5.8.6/Carp.pm:269], [/usr/local/lib/perl5/site_perl/5.8.6/Class/DBI.pm:169], [/usr/local/lib/perl5/site_perl/5.8.6/Class/DBI.pm:437], ...
On Thu Mar 08 15:31:46 2007, finlayt wrote: Show quoted text
> [error] __triggers is not a column of NewsAgent::Block::History at > /usr/local/lib/perl5/site_perl/5.8.6/Class/Trigger.pm line 41 > Stack: [/usr/local/lib/perl5/5.8.6/Carp.pm:269], > [/usr/local/lib/perl5/site_perl/5.8.6/Class/DBI.pm:169], > [/usr/local/lib/perl5/site_perl/5.8.6/Class/DBI.pm:437], > ...
That error is coming from inside one of your own triggers, line 41 calls a trigger. Did you do something like this? $copy = $class->insert($obj); Class::Trigger adds a __triggers key to each object, so if you just feed a CDBI object into insert() it's going to think it's a column. You can often get away with $obj->{$column} but you can rarely get away with %$obj. If Class::Trigger didn't break it something else would have. Instead you probably want to call copy() or filter the hash keys by all_columns().