Skip Menu |

This queue is for tickets about the Maypole CPAN distribution.

Report information
The Basics
Id: 6675
Status: resolved
Priority: 0/
Queue: Maypole

People
Owner: Nobody in particular
Requestors: pcampbell [...] kemitix.net
Cc:
AdminCc:

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



Subject: Doesn't cope with '/'s in Primary Key fields
If a table's Primary Key contains any '/' characters then only that part of the key prior to the first '/' is used to create links. Thus rendering it impossible to select such a record for editing. Example: Primary key: '/rss.xml' URL: 'http://217.0.0.1/testapp/urls/view//rss.xml' Maypole.pm:line 125: my @pi = split /\//, $self->{path}; Leaves @pi (after cleaning) with: ['urls','view','','rss.xml'] These are then mapped as: table => 'urls', action => 'view', args => ['','rss.xml'] Maypole::Mode::Base:line 16: my $obj = $class->retrieve( $r->{args}->[0] ); Which will attempt to retirieve a record with a primary key of ''.
[guest - Sat Jun 19 19:04:03 2004]: Show quoted text
> If a table's Primary Key contains any '/' characters then only that > part of the key prior to the first '/' is used to create links. Thus > rendering it impossible to select such a record for editing.
This is something I'm not going to fix; if you're using non-numeric primary keys and this is a problem, you probably want to also supply your own parse_path routine. Sorry, but there's no easy fix and I have to draw a line somewhere; the line is "we recommend numeric IDs and if you don't follow that you're on your own." Simon
[SIMON - Mon Jun 21 09:34:09 2004]: Show quoted text
> Sorry, but there's no easy fix and I have to draw a line somewhere; > the line is "we recommend numeric IDs and if you don't follow that > you're on your own." > > Simon
Thanks for the help. I'll add a seperate Primary Key and add a unique index on the URL field instead. Paul