Bug 34357

Summary: Subroutine Koha::ItemType::SUPER::imageurl redefined
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: Architecture, internals, and plumbingAssignee: Bugs List <koha-bugs>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: fridolin.somers, glasklas, jonathan.druart
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00
Circulation function:
Bug Depends on: 33745    
Bug Blocks:    
Attachments: Bug 34357: Replace SUPER->imageurl in ItemTypes
Bug 34357: Replace SUPER->imageurl in ItemTypes
Bug 34357: Replace SUPER->imageurl in ItemTypes

Description Marcel de Rooy 2023-07-24 14:09:50 UTC
This becomes visible since Bug 33745: Lazily create attribute accessor methods in AUTOLOAD.

Note that Koha::ItemType was introduced with an unneeded SUPER reference on commit db2a1aa0dda1c786c34c3cf239fccfcaedefd094:
+sub image_location {
+    my ( $self, $interface ) = @_;
+    return C4::Koha::getitemtypeimagelocation( $interface, $self->SUPER::imageurl );
+}

We should just use $self->imageurl.
Comment 1 Marcel de Rooy 2023-07-24 14:10:29 UTC
Created attachment 153838 [details] [review]
Bug 34357: Replace SUPER->imageurl in ItemTypes

Test plan:
Run t/db_dependent/Koha/ItemTypes.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Marcel de Rooy 2023-07-24 14:11:43 UTC
(In reply to Marcel de Rooy from comment #0)
> Note that Koha::ItemType was introduced with an unneeded SUPER reference on
> commit db2a1aa0dda1c786c34c3cf239fccfcaedefd094:
> +sub image_location {
> +    my ( $self, $interface ) = @_;
> +    return C4::Koha::getitemtypeimagelocation( $interface,
> $self->SUPER::imageurl );
> +}

Any idea why this was introduced like that, Jonathan?
Comment 3 Jonathan Druart 2023-07-24 15:46:02 UTC
Created attachment 153844 [details] [review]
Bug 34357: Replace SUPER->imageurl in ItemTypes

Test plan:
Run t/db_dependent/Koha/ItemTypes.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 Jonathan Druart 2023-07-24 15:46:32 UTC
(In reply to Marcel de Rooy from comment #2)
> (In reply to Marcel de Rooy from comment #0)
> > Note that Koha::ItemType was introduced with an unneeded SUPER reference on
> > commit db2a1aa0dda1c786c34c3cf239fccfcaedefd094:
> > +sub image_location {
> > +    my ( $self, $interface ) = @_;
> > +    return C4::Koha::getitemtypeimagelocation( $interface,
> > $self->SUPER::imageurl );
> > +}
> 
> Any idea why this was introduced like that, Jonathan?

No idea, that does not seem to make sense here.
Comment 5 Katrin Fischer 2023-07-29 19:35:18 UTC
Created attachment 154060 [details] [review]
Bug 34357: Replace SUPER->imageurl in ItemTypes

Test plan:
Run t/db_dependent/Koha/ItemTypes.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Tomás Cohen Arazi (tcohen) 2023-08-15 09:14:18 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 7 Fridolin Somers 2023-08-17 19:32:41 UTC
Depends on Bug 33745 not in 23.05.x