From 7434ac23edb9d3955925fc121b18a0fdc44bc03b Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 14 Jul 2023 09:29:59 +0000 Subject: [PATCH] Bug 33745: (QA follow-up) Tidy Content-Type: text/plain; charset=utf-8 Signed-off-by: Marcel de Rooy --- Koha/Object.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Koha/Object.pm b/Koha/Object.pm index f045169418..190b57cde9 100644 --- a/Koha/Object.pm +++ b/Koha/Object.pm @@ -907,19 +907,20 @@ sub AUTOLOAD { my @columns = @{$self->_columns()}; if ( grep { $_ eq $method } @columns ) { + # Lazy definition of get/set accessors like $item->barcode; note that it contains $method my $accessor = sub { my $self = shift; - if ( @_ ) { - $self->_result()->set_column( $method, @_); + if (@_) { + $self->_result()->set_column( $method, @_ ); return $self; } else { - return $self->_result()->get_column( $method ); + return $self->_result()->get_column($method); } }; no strict 'refs'; *{$AUTOLOAD} = $accessor; - return $accessor->($self, @_); + return $accessor->( $self, @_ ); } my @known_methods = qw( is_changed id in_storage get_column discard_changes make_column_dirty ); -- 2.30.2