Skip Menu |

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

Report information
The Basics
Id: 56179
Status: resolved
Priority: 0/
Queue: DBIx-Class-Journal

People
Owner: Nobody in particular
Requestors: clayton [...] physics.umn.edu
Cc:
AdminCc:

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



Subject: Auditing failure on update
Date: Wed, 31 Mar 2010 15:24:57 -0500
To: bug-DBIx-Class-Journal [...] rt.cpan.org
From: Andy Clayton <clayton [...] physics.umn.edu>
Hello, While testing out the latest development version, 0.900001_03, I ran into a problem with auditing on updating. It seems that it inserts the object rather than the id: INSERT INTO "artist_audit_history" VALUES(3, 'Music::Schema::Journal::ChangeLog=HASH(0x8d14bf4)', 1, 'Cloud Cult'); This is also observable in the database generated by the first test: INSERT INTO "cd_audit_history" VALUES(2, 'DBICTest::Schema::_JOURNAL::ChangeLog=HASH(0x8fca278)', 1, 1, 'Angry young man', '2000'); This is somewhat puzzling as I would think that passing the ChangeLog row to create should work, though maybe the problem is that the relation is the same name as the column? Regardless, changing it to explicitly use the id--just as create does--fixes the problem. I've attached a patch, and I should hopefully have time tomorrow or the next to write one for the tests as well. Thanks, -Andy
Index: Journal.pm =================================================================== --- Journal.pm (revision 1401) +++ Journal.pm (revision 1423) @@ -69,9 +69,9 @@ if($self->in_storage) { my $j = $self->_journal_schema; - my $change = $j->journal_create_change; + my $change_id = $j->journal_create_change()->id; my $prev = $self->result_source->resultset->find( $self->ident_condition ); - $j->journal_record_in_history( $prev, audit_change_id => $change ); + $j->journal_record_in_history( $prev, audit_change_id => $change_id ); } }
Subject: Re: [rt.cpan.org #56179] Auditing failure on update
Date: Wed, 31 Mar 2010 14:39:46 -0600
To: bug-DBIx-Class-Journal [...] rt.cpan.org
From: fREW Schmidt <frioux [...] gmail.com>
Thanks so much for looking at all of these issues! I will apply both of your patches (hopefully) tonight. On Wed, Mar 31, 2010 at 2:25 PM, Andy Clayton via RT < bug-DBIx-Class-Journal@rt.cpan.org> wrote: Show quoted text
> Wed Mar 31 16:25:14 2010: Request 56179 was acted upon. > Transaction: Ticket created by clayton@physics.umn.edu > Queue: DBIx-Class-Journal > Subject: Auditing failure on update > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: clayton@physics.umn.edu > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=56179 > > > > Hello, > > While testing out the latest development version, 0.900001_03, I ran > into a problem with auditing on updating. It seems that it inserts the > object rather than the id: > > INSERT INTO "artist_audit_history" VALUES(3, > 'Music::Schema::Journal::ChangeLog=HASH(0x8d14bf4)', 1, 'Cloud Cult'); > > This is also observable in the database generated by the first test: > > INSERT INTO "cd_audit_history" VALUES(2, > 'DBICTest::Schema::_JOURNAL::ChangeLog=HASH(0x8fca278)', 1, 1, 'Angry > young man', '2000'); > > This is somewhat puzzling as I would think that passing the ChangeLog > row to create should work, though maybe the problem is that the relation > is the same name as the column? Regardless, changing it to explicitly > use the id--just as create does--fixes the problem. I've attached a > patch, and I should hopefully have time tomorrow or the next to write > one for the tests as well. > > Thanks, > -Andy > > >
-- fREW Schmidt http://blog.afoolishmanifesto.com
Subject: Re: [rt.cpan.org #56179] Auditing failure on update
Date: Fri, 02 Apr 2010 11:29:43 -0500
To: bug-DBIx-Class-Journal [...] rt.cpan.org
From: Andy Clayton <clayton [...] physics.umn.edu>
Thanks! I also realize now why passing the ChangeLog object wasn't working. When I said the column and relation were the same I was confused... they aren't the same. The relation is called change, so that is what would have made the object work. -Andy Show quoted text
>> >> This is somewhat puzzling as I would think that passing the ChangeLog >> row to create should work, though maybe the problem is that the relation >> is the same name as the column? Regardless, changing it to explicitly >> use the id--just as create does--fixes the problem. I've attached a >> patch, and I should hopefully have time tomorrow or the next to write >> one for the tests as well. >> >> Thanks, >> -Andy >> >> >> >>
> > >
fixed in commit 9193