Created attachment 58583 [details] [review] Bug 17843: Repace C4::Koha::getitemtypeinfo with Koha::ItemTypes The C4::Koha::getitemtypeinfo subroutine did the almost same job as GetItemTypes. On top of that it returned the imageurl value processed by C4::Koha::getitemtypeimagelocation. This value is only used from the 2 [opac-]shelves.pl scripts. Then it's better not retrieve it only when we need it. Test plan: Play with the different scripts touched by this patch and focus on item types. The same description as prior to this patch must be displayed. Note that sometimes it is not the translated description which is displayed, but that should be fixed on another bug report. Indeed we do not expect this patch to change any behaviors.
Created attachment 58584 [details] [review] Bug 17843: Remove C4::Koha::getitemtypeinfo At this point there should not be any calls to this subroutine.
Created attachment 61972 [details] [review] Bug 17843: Replace C4::Koha::getitemtypeinfo with Koha::ItemTypes The C4::Koha::getitemtypeinfo subroutine did the almost same job as GetItemTypes. On top of that it returned the imageurl value processed by C4::Koha::getitemtypeimagelocation. This value is only used from the 2 [opac-]shelves.pl scripts. Then it's better not retrieve it only when we need it. Test plan: Play with the different scripts touched by this patch and focus on item types. The same description as prior to this patch must be displayed. Note that sometimes it is not the translated description which is displayed, but that should be fixed on another bug report. Indeed we do not expect this patch to change any behaviors. Signed-off-by: Lari Taskula <lari.taskula@jns.fi>
Created attachment 61973 [details] [review] Bug 17843: Remove C4::Koha::getitemtypeinfo At this point there should not be any calls to this subroutine. Signed-off-by: Lari Taskula <lari.taskula@jns.fi>
Rebased on top of master, fixed a minor conflict and typo in patch title. Tested scripts touched by first patch. Switching to Signed Off.
Created attachment 62266 [details] [review] Bug 17843: Replace C4::Koha::getitemtypeinfo with Koha::ItemTypes The C4::Koha::getitemtypeinfo subroutine did the almost same job as GetItemTypes. On top of that it returned the imageurl value processed by C4::Koha::getitemtypeimagelocation. This value is only used from the 2 [opac-]shelves.pl scripts. Then it's better not retrieve it only when we need it. Test plan: Play with the different scripts touched by this patch and focus on item types. The same description as prior to this patch must be displayed. Note that sometimes it is not the translated description which is displayed, but that should be fixed on another bug report. Indeed we do not expect this patch to change any behaviors. Signed-off-by: Lari Taskula <lari.taskula@jns.fi>
Created attachment 62267 [details] [review] Bug 17843: Remove C4::Koha::getitemtypeinfo At this point there should not be any calls to this subroutine. Signed-off-by: Lari Taskula <lari.taskula@jns.fi>
Created attachment 64400 [details] [review] Bug 17843: Replace C4::Koha::getitemtypeinfo with Koha::ItemTypes The C4::Koha::getitemtypeinfo subroutine did the almost same job as GetItemTypes. On top of that it returned the imageurl value processed by C4::Koha::getitemtypeimagelocation. This value is only used from the 2 [opac-]shelves.pl scripts. Then it's better not retrieve it only when we need it. Test plan: Play with the different scripts touched by this patch and focus on item types. The same description as prior to this patch must be displayed. Note that sometimes it is not the translated description which is displayed, but that should be fixed on another bug report. Indeed we do not expect this patch to change any behaviors. Signed-off-by: Lari Taskula <lari.taskula@jns.fi>
Created attachment 64401 [details] [review] Bug 17843: Remove C4::Koha::getitemtypeinfo At this point there should not be any calls to this subroutine. Signed-off-by: Lari Taskula <lari.taskula@jns.fi>
QA: Looking here now
Created attachment 64582 [details] [review] Bug 17843: Replace C4::Koha::getitemtypeinfo with Koha::ItemTypes The C4::Koha::getitemtypeinfo subroutine did the almost same job as GetItemTypes. On top of that it returned the imageurl value processed by C4::Koha::getitemtypeimagelocation. This value is only used from the 2 [opac-]shelves.pl scripts. Then it's better not retrieve it only when we need it. Test plan: Play with the different scripts touched by this patch and focus on item types. The same description as prior to this patch must be displayed. Note that sometimes it is not the translated description which is displayed, but that should be fixed on another bug report. Indeed we do not expect this patch to change any behaviors. Signed-off-by: Lari Taskula <lari.taskula@jns.fi> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 64583 [details] [review] Bug 17843: Remove C4::Koha::getitemtypeinfo At this point there should not be any calls to this subroutine. Signed-off-by: Lari Taskula <lari.taskula@jns.fi> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 64584 [details] [review] Bug 17843: [QA Follow-up] Some polishing Resolve warning from members/summary-print.pl: "my" variable $itemtype masks earlier declaration in same scope Test if find returns a Koha object in GetDescription. Test if find returns a Koha object too in shelves.pl. While testing, I had a crash on a biblioitem with itemtype NULL (bad record, but these things tend to happen somehow.) Can't call method "imageurl" on an undefined value at virtualshelves/shelves.pl line 253. Same for opac/opac-shelves.pl. Note: Did not add tests everywhere but generally, I have the impression that we do not sufficiently test on the results of Koha::Object->find. Mostly we just assume that it will find a record. Several reports include fixes to resolve that wrong assumption. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Pushed to master for 17.11, thanks to everybody involved!
Enhancement not pushed to 17.05.x