Skip Menu |

This queue is for tickets about the HTML-FormHandler-Model-DBIC CPAN distribution.

Report information
The Basics
Id: 58451
Status: resolved
Priority: 0/
Queue: HTML-FormHandler-Model-DBIC

People
Owner: Nobody in particular
Requestors: perl [...] tanoti.org
Cc:
AdminCc:

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



Subject: Table with ID column not as primary key causes update not insert
Running on "Linux dagobar 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38 EST 2008 x86_64 x86_64 x86_64 GNU/Linux" Perl version 5.12.0 We have a legacy table that contains a column "ID" as a non-primary key column. When using HTML::FormHandler's process() function under Catalyst to create a new row in this table by passing item_id as undef, if the value in the "ID" form field happens to match a value in the primary key column, the row is updated rather than a new record inserted as exepected. # Validate and insert database return unless $self->form->process( item_id => undef, params => $c->req->parameters, schema => $c->model('ConfigDB')->schema, ); It looks like there may be an assumption that a column called "ID" will be the primary key?
This is actually an issue with DBIx::Class::ResultSet::RecursiveUpdate, not the FormHandler DBIC model. If you still want to pursue this... after all this time... you could open up a ticket there. It does a check for 'id', I assume because DBIx::Class has an uses 'id' as a synonym for the primary key. But I'm not sure it makes sense where it's done in RU.