Skip Menu |
 

This queue is for tickets about the DBIx-Class-Schema-Loader CPAN distribution.

Report information
The Basics
Id: 81112
Status: open
Priority: 0/
Queue: DBIx-Class-Schema-Loader

People
Owner: Nobody in particular
Requestors: CMCKAY [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: (no value)
Fixed in: (no value)



Subject: accessors name sanity checking is breaking existing code
Download (untitled) / with headers
text/plain 362b
Hi, Upgraded Class::Accessor::Grouped and some of my existing code stopped working. The code in question is a dbix::class schema generated by DBIx::Class::Schema::Loader and used one of my db column names (1900_call_description) as an accessor name. Can you revert the sanity checking so accessors can start with a digit again please. Thanks, -Chris Mckay
Download (untitled) / with headers
text/plain 1.4k
I switched the queue of this bug, as it is S::L's problem, not CAG's. You are confusing the ability to have columns with any name, with the ability to create an arbitrary accessor name. You may not do the later in perl (at least not normally) - every accessor must* conform to /\A[A-Z_a-z][0-9A-Z_a-z]*\z/. This is not only limited to numbers - S::L has a general deficiency in constructiong accessor names. It has been argued for several years that S::L must sanitycheck all resulting accessor names and specify 'accessor => undef' for anything that seems out of line. Sadly the former maintainer was extremely uncooperative on this problem. So two courses of action: Long term _default_column_accessor_name() needs a facelift to stop asking the system to create accessors with illegal names (patches very very very welcome). Short term all you need to do is provide a custom column naming callback via https://metacpan.org/module/DBIx::Class::Schema::Loader::Base#col_accessor_map In the meantime I will have to re-relase a CAG with the ability to shutoff the check via an envvar. Creating broken accessor names however will not be the default mode of operation. Cheers * The "must" here is a little ambiguous. One of course can always do $obj->${\"666 random crap of a name"}, but one can never do 'sub 666_haha { ... }'. Since the job of CAG is to make generally accessible accessors (haha), there is little argument in allowing weird naming. Especially given the workaround availability as stated above.
Download (untitled) / with headers
text/plain 480b
On Sun Nov 11 23:54:27 2012, CMCKAY wrote: Show quoted text
> Can you revert the sanity checking so accessors can start with a digit > again please.
Class::Accessor::Grouped with a builtin escape hatch uploaded to CPAN. Sorry for the delay. Rationale can be found here[1]. The bug is still valid and critical - DBIC::SL must stop attempting to create bogus accessors. [1] https://metacpan.org/module/RIBASUSHI/Class-Accessor-Grouped-0.10008/lib/Class/Accessor/Grouped.pm#Notes-on-accessor-names


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.