Bug 33069

Summary: File download from list in OPAC gives error
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: OPACAssignee: Katrin Fischer <katrin.fischer>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: critical    
Priority: P5 - low CC: jonathan.druart, kevin.ayrault87, lucas
Version: MainKeywords: rel_22_11_candidate
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.06
Circulation function:
Bug Depends on: 29697    
Bug Blocks:    
Attachments: Bug 33069: Fix error in MARC download for OPAC lists
Bug 33069: Fix error in MARC download for OPAC lists
Bug 33069: Fix error in MARC download for OPAC lists
Bug 33069: Fix error in MARC download for OPAC lists

Description Katrin Fischer 2023-02-24 17:02:12 UTC
When trying to download the list contents in MARC in the OPAC, I get the following error:

Not a CODE reference at /kohadevbox/koha/opac/opac-downloadshelf.pl line 93
Comment 1 Katrin Fischer 2023-02-24 17:03:11 UTC
The same records download ok from the cart.
Comment 2 Kévin AYRAULT 2023-05-03 13:48:24 UTC
I have the same error and after check the code, i see maybe the correction. 
In line 93, there is an extra "->" after "record" in my opinion. 
When I replace the line "my $record = $biblio->metadata->record->(" with "my $record = $biblio->metadata->record(", the download works.
Comment 3 Katrin Fischer 2023-05-03 21:31:22 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2023-05-03 21:32:20 UTC
(In reply to Kévin AYRAULT from comment #2)
> I have the same error and after check the code, i see maybe the correction. 
> In line 93, there is an extra "->" after "record" in my opinion. 
> When I replace the line "my $record = $biblio->metadata->record->(" with "my
> $record = $biblio->metadata->record(", the download works.

Thank you! This was the problem, with the change the error is gone :)
Comment 5 Magnus Enger 2023-05-04 07:55:45 UTC
Created attachment 150631 [details] [review]
Bug 33069: Fix error in MARC download for OPAC lists

There was a code typo causing an error when you tried
to download a list in MARC format:

Not a CODE reference at /kohadevbox/koha/opac/opac-downloadshelf.pl line 93

To test:
* In the OPAC: create a new list, public or private, with some records
* Open the list
* Try to download the list as MARC
* Verify you get an error
* Apply patch
* Verify you now get the expected download file
* Sign off :)

Co-authored-by: Kévin AYRAULT <kevin.ayrault87@gmail.com>
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Nasty error before the patch; nice, tasty MARC download after.
Comment 6 Katrin Fischer 2023-05-04 08:29:09 UTC
Thx Magnus :)
Comment 7 Hinemoea Viault 2023-05-08 20:48:04 UTC
Created attachment 150807 [details] [review]
Bug 33069: Fix error in MARC download for OPAC lists

There was a code typo causing an error when you tried
to download a list in MARC format:

Not a CODE reference at /kohadevbox/koha/opac/opac-downloadshelf.pl line 93

To test:
* In the OPAC: create a new list, public or private, with some records
* Open the list
* Try to download the list as MARC
* Verify you get an error
* Apply patch
* Verify you now get the expected download file
* Sign off :)

Co-authored-by: Kévin AYRAULT <kevin.ayrault87@gmail.com>
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Nasty error before the patch; nice, tasty MARC download after.
Signed-off-by: Hinemoea Viault <hinemoea.viault@inlibro.com>
Comment 8 Jonathan Druart 2023-05-09 09:55:50 UTC
Created attachment 150835 [details] [review]
Bug 33069: Fix error in MARC download for OPAC lists

There was a code typo causing an error when you tried
to download a list in MARC format:

Not a CODE reference at /kohadevbox/koha/opac/opac-downloadshelf.pl line 93

To test:
* In the OPAC: create a new list, public or private, with some records
* Open the list
* Try to download the list as MARC
* Verify you get an error
* Apply patch
* Verify you now get the expected download file
* Sign off :)

Co-authored-by: Kévin AYRAULT <kevin.ayrault87@gmail.com>
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Nasty error before the patch; nice, tasty MARC download after.
Signed-off-by: Hinemoea Viault <hinemoea.viault@inlibro.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 9 Tomás Cohen Arazi (tcohen) 2023-05-09 13:51:34 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 10 Martin Renvoize (ashimema) 2023-05-12 15:36:23 UTC
Many hands makes light work, thankyou everyone!

Pushed to 22.11.x for the next release
Comment 11 Lucas Gass (lukeg) 2023-06-15 14:52:21 UTC
Missing dependencies for 22.05.x, no backport.