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

Dave Howorth dhoworth@mrc-lmb.cam.ac.uk
Fri, 11 Feb 2005 11:00:09 +0000


Torsten Seemann wrote:
> 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?

> 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;

Thinking about it a little more, I believe that as well as calling 
untaint_columns you'll actually need to write a custom do_edit action 
because of that UNIQUE constraint. This is outside my experience, but 
AFAIK neither CDBI nor Maypole has any means of generating a 
'pseudo-CGI-validation error' to give the user another chance without 
you writing some extra code.

Cheers, Dave