[Maypole] Unusual error involving CDBI - DBIx:CF - FromCGI

Torsten Seemann torsten.seemann@infotech.monash.edu.au
Fri, 11 Feb 2005 13:38:38 +1100


Hi,

I just put together a basic Maypole app using automatic setup
to a MySQL InnoDB database. Actions "list" and "view" seem to
work ok, but any create or edit seem to do nothing, ie "do_edit". 

The following errors appear in the web server error log (and also when I
use Maypole::CLI). Also appended is a table schema and my Maypole class.

Any ideas what would cause these errors or cause do_edit to fail?

Thanks for any help!

--Torsten


[Fri Feb 11 11:45:17 2005] [error]  Loaded tables:
gel,gene,oligo,organism,pcr,person at
/usr/lib/perl5/site_perl/5.8.3/Maypole/Model/CDBI.pm line 244., referer:
http://localhost/boyligo/maypole.cgi/person/do_edit/

[Fri Feb 11 11:45:17 2005] [error]  Can't insert new
Boypole::Person: DBD::mysql::st execute failed: Duplicate entry '' for
key 2 [for Statement "INSERT INTO person (id), referer:
http://localhost/boyligo/maypole.cgi/person/do_edit/

[Fri Feb 11 11:45:17 2005] [error]  VALUES (?),
referer: http://localhost/boyligo/maypole.cgi/person/do_edit/

[Fri Feb 11 11:45:17 2005] [error]  "] at
/usr/lib/perl5/site_perl/5.8.3/DBIx/ContextualFetch.pm line 51.,
referer: http://localhost/boyligo/maypole.cgi/person/do_edit/

[Fri Feb 11 11:45:17 2005] [error]   at
/usr/lib/perl5/site_perl/5.8.3/Class/DBI/FromCGI.pm line 246, referer:
http://localhost/boyligo/maypole.cgi/person/do_edit/


CREATE TABLE `person` (
        `login` VARCHAR(100) UNIQUE NOT NULL,
        `name` VARCHAR(100) NOT NULL,
        `email` VARCHAR(100) NOT NULL,
        `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
) ENGINE=InnoDB;


package Boypole;
use Maypole::Application qw(-Debug);
use Class::DBI::Loader::Relationship;
__PACKAGE__->setup("dbi:mysql:XXX", "YYY", "ZZZ");
__PACKAGE__->config->application_name('Boyligo');
__PACKAGE__->config->uri_base( ETC );
__PACKAGE__->config->template_root( ETC );
1;