Bug 33069 - File download from list in OPAC gives error
Summary: File download from list in OPAC gives error
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low critical
Assignee: Katrin Fischer
QA Contact: Testopia
URL:
Keywords: rel_22_11_candidate
Depends on: 29697
Blocks:
  Show dependency treegraph
 
Reported: 2023-02-24 17:02 UTC by Katrin Fischer
Modified: 2024-07-04 20:37 UTC (History)
3 users (show)

See Also:
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:


Attachments
Bug 33069: Fix error in MARC download for OPAC lists (1.44 KB, patch)
2023-05-03 21:31 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 33069: Fix error in MARC download for OPAC lists (1.55 KB, patch)
2023-05-04 07:55 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 33069: Fix error in MARC download for OPAC lists (1.61 KB, patch)
2023-05-08 20:48 UTC, Hinemoea Viault
Details | Diff | Splinter Review
Bug 33069: Fix error in MARC download for OPAC lists (1.69 KB, patch)
2023-05-09 09:55 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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.