
adrian at gossamer-threads
Feb 6, 2009, 10:05 AM
Views: 2002
Permalink
|
|
Patch to fix accessors in Bric::Biz::Element::Field
|
|
Hi, While figuring things out for the in-place editor, I ran into what seems like a bug where Bric::Biz::Element::Field->get_max_length was returning $self instead of the max_length. I took a look at the SVN log, but there wasn't a message relating to why it was added: http://viewsvn.bricolage.cc/bricolage/trunk/lib/Bric/Biz/Element/Field.pm?view=diff&r1=6698&r2=6699 Here's the patch, essentially removing the bit of code and relying on the built in accessors: ***** start patch ***** Index: lib/Bric/Biz/Element/Field.pm =================================================================== --- lib/Bric/Biz/Element/Field.pm (revision 8406) +++ lib/Bric/Biz/Element/Field.pm (working copy) @@ -731,12 +731,6 @@ =cut -sub get_max_length { - my $self = shift; - return $self if $self->_get('max_length'); - return; -} - ############################################################################## =item my $sql_type = $data->get_sql_type ***** end patch ***** There are a couple other methods which do the same thing that may want to be removed/fixed as well: is_autopopulated, is_multiple Adrian
|