From 08dbf71db0e9ebe9422b2a815436e74d3fc476d2 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 --- Koha/Illrequestattribute.pm | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Koha/Illrequestattribute.pm b/Koha/Illrequestattribute.pm index 6c0c584ddc4..b5b75dee3dc 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.41.0