Skip Menu |

This queue is for tickets about the Maypole CPAN distribution.

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

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

Bug Information
Severity: Normal
Broken in: 2.10
Fixed in: 2.11



Subject: model search/delete methods model and subclassing the cdbi model
Problems with clashing delete/search methods can occur when subclassing the cdbi model, as class::dbi and any equivilent will use these methodnames. Matt S Trout has provided a quick fix that will enable subclassing to work nicer.. my ($sub) = (caller(1))[3]; $sub =~ /^(.+)::([^:]+)$/; # So subclasses can still send search down ... return shift->SUPER::search(@_) if ($1 ne "Maypole::Model::Base" && $2 ne "search"); It is reccomended that you use the new do_search/do_delete model methods to avoid method resolution clashes.
[TEEJAY - Wed Dec 21 07:57:49 2005]: Show quoted text
> Problems with clashing delete/search methods can occur when > subclassing > the cdbi model, as class::dbi and any equivilent will use these > methodnames. > > Matt S Trout has provided a quick fix that will enable subclassing to > work nicer.. > > my ($sub) = (caller(1))[3]; > $sub =~ /^(.+)::([^:]+)$/; > # So subclasses can still send search down ... > return shift->SUPER::search(@_) if ($1 ne "Maypole::Model::Base" && > $2 ne "search"); > > It is reccomended that you use the new do_search/do_delete model > methods > to avoid method resolution clashes.
I am updating the Model classes to provide do_search and do_delete, and for the CDBI model to call either the SUPER::search or do_search depending on the improved hack that MST has provided. Once I can commit these changes to SVN, I'll provide the revision number here.
[TEEJAY - Wed Dec 21 07:59:33 2005]: Show quoted text
> [TEEJAY - Wed Dec 21 07:57:49 2005]: >
> > Problems with clashing delete/search methods can occur when > > subclassing > > the cdbi model, as class::dbi and any equivilent will use these > > methodnames. > > > > Matt S Trout has provided a quick fix that will enable subclassing to > > work nicer.. > > > > my ($sub) = (caller(1))[3]; > > $sub =~ /^(.+)::([^:]+)$/; > > # So subclasses can still send search down ... > > return shift->SUPER::search(@_) if ($1 ne "Maypole::Model::Base" && > > $2 ne "search"); > > > > It is reccomended that you use the new do_search/do_delete model > > methods > > to avoid method resolution clashes.
> > > I am updating the Model classes to provide do_search and do_delete, and > for the CDBI model to call either the SUPER::search or do_search > depending on the improved hack that MST has provided. > > Once I can commit these changes to SVN, I'll provide the revision number > here.
Fixed in SVN 442