Skip Menu |

This queue is for tickets about the Class-DBI CPAN distribution.

Report information
The Basics
Id: 5682
Status: resolved
Priority: 0/
Queue: Class-DBI

People
Owner: Nobody in particular
Requestors: domm [...] zsi.at
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.95
Fixed in: 0.96



Subject: Problem with add_constructor and inheritance
IMO add_constructor is semi-broken. If a have a base Class: MyApp and do MyApp->add_constructor(retrieve_public,'some sql'); and a class inheriting from MyAll, MyAll::SpecialCase in which I want to set another constructor 'retrieve_public', via MyApp::SpecialCase->add_constructor(retrieve_public,'some ohter sql'); Class::DBI croaks "$method already exists in $class" This happens because add_costructor checks $class->can($method), when IMO it should check if there is a CODE-Typeglob (or whatever this is called) in the actual package. The attached patch changes the behaviour of add_constructor to allow subclassing of constructors. I didn't take a closer look if this problem occures in other comparable methods, too.
Download cdbi_patch
application/octet-stream 813b

Message body not shown because it is not plain text.