From a0161771ce3169c08ddd9a9572c675003051930c Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 19 Oct 2023 14:32:28 +0100 Subject: [PATCH] Bug 33970: Compatability schim This adds a compatability option to allow older backends not passing their backend code through to the attributes on store. Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi --- Koha/Illrequestattribute.pm | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Koha/Illrequestattribute.pm b/Koha/Illrequestattribute.pm index 6c0c584ddc..b5b75dee3d 100644 --- a/Koha/Illrequestattribute.pm +++ b/Koha/Illrequestattribute.pm @@ -29,6 +29,35 @@ Koha::Illrequestattribute - Koha Illrequestattribute Object class =head1 API +=head2 Class methods + +=head3 store + +Overloaded store method to ensure we have backend filled if not already passed + +=cut + +sub store { + my ($self) = @_; + + if ( !$self->backend ) { + $self->backend( $self->request->backend ); + } + + return $self->SUPER::store; +} + +=head3 request + +Returns a Koha::Illrequest object representing the core request. + +=cut + +sub request { + my ($self) = @_; + return Koha::Illrequest->_new_from_dbic( $self->_result->illrequest ); +} + =head2 Internal methods =head3 _type -- 2.20.1