Skip Menu |

This queue is for tickets about the Maypole CPAN distribution.

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

People
Owner: TEEJAY [...] cpan.org
Requestors: peterspeltz [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 2.09
Fixed in: 2.11



Subject: Temlate list table heading links
In the list template, the table headings are automatically made into links for sorting by that column. But if the current "list_column" is not a real Column and is an acessor to another object or just a simple method , then clicking the link made, causes a DBIx exception. Simple fix it wrap that link making code in an IF model_obj.find_column(col); # do fancy sorting link making code ELSE: # no link as sorting on related data is hard classmetadata.colnames.$col || col FILTER ucfirst; END; cheers, Peter
[PSPELTZ - Sat Oct 1 20:46:57 2005]: Show quoted text
> In the list template, the table headings are automatically made into > links for sorting by that column. But if the current "list_column" > is not a real Column and is an acessor to another object or just a > simple method , then clicking the link made, causes a DBIx > exception. > > Simple fix it wrap that link making code in an > > IF model_obj.find_column(col); > > # do fancy sorting link making code > > ELSE: > # no link as sorting on related data is hard > classmetadata.colnames.$col || col FILTER ucfirst; > END; > > cheers, > > Peter
P.S. To simply see what I am talking about put a might_have relationship accessor in your list_columns. Or if you don't have one, make a method sub list_test { "I am not a column" } and put "list_test" in your list_columns.
[PSPELTZ - Sat Oct 1 20:46:57 2005]: Show quoted text
> In the list template, the table headings are automatically made into > links for sorting by that column. But if the current "list_column" > is not a real Column and is an acessor to another object or just a > simple method , then clicking the link made, causes a DBIx > exception. > > Simple fix it wrap that link making code in an > > IF model_obj.find_column(col); > > # do fancy sorting link making code > > ELSE: > # no link as sorting on related data is hard > classmetadata.colnames.$col || col FILTER ucfirst; > END; > > cheers, > > Peter
This fixes it for CDBI based models. Sorry for being so CDBI-centric. Actually I'm not. CDBI rocks.
[PSPELTZ - Mon Oct 10 20:25:56 2005]: Show quoted text
> [PSPELTZ - Sat Oct 1 20:46:57 2005]: >
> > In the list template, the table headings are automatically made into > > links for sorting by that column. But if the current
> "list_column"
> > is not a real Column and is an acessor to another object or just
> a
> > simple method , then clicking the link made, causes a DBIx > > exception. > > > > Simple fix it wrap that link making code in an > > > > IF model_obj.find_column(col); > > > > # do fancy sorting link making code > > > > ELSE: > > # no link as sorting on related data is hard > > classmetadata.colnames.$col || col FILTER ucfirst; > > END; > > > > cheers, > > > > Peter
> > > This fixes it for CDBI based models. Sorry for being so CDBI-centric. > Actually I'm not. CDBI rocks.
This should be fixed in 392