Bug 32555 - Error when viewing serial in OPAC
Summary: Error when viewing serial in OPAC
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Serials (show other bugs)
Version: Main
Hardware: All All
: P5 - low critical (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Katrin Fischer
URL:
Keywords: rel_22_11_candidate
Depends on: 27272
Blocks:
  Show dependency treegraph
 
Reported: 2023-01-02 17:48 UTC by Caroline Cyr La Rose
Modified: 2023-12-28 20:42 UTC (History)
5 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.03


Attachments
Bug 32555: Fix serial vs. serialitem typo (2.71 KB, patch)
2023-01-30 18:41 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 32555: Fix serial vs. serialitem typo (2.77 KB, patch)
2023-01-30 19:11 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 32555: Fix serial vs. serialitem typo (2.83 KB, patch)
2023-01-30 23:21 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Caroline Cyr La Rose 2023-01-02 17:48:30 UTC
I'm getting a 500 error when trying to view a serial with issues in the OPAC. The message is very long, but it starts with

Template process failed: undef error - The method Koha::Serial::Item->serialseq is not covered by tests!


To test:
1. Create a serial subscription
   1.1. Go to Serials
   1.2. Click on New subscription
   1.3. Fill out the first form
        - Vendor: leave empty
        - Record: enter a record number (I used 108)
        - Create an item record when receiving this serial
        - When there is an irregular issue: Keep issue number
        - Manual history: leave unchecked
        - Call number: leave empty
        - Library: Centerville
        - Public/nonpublic note: leave empty
        - Patron notification: None
        - Location: None
        - Collection: None
        - Item type: Continuing resources
        - Grace period: leave empty
        - Number of issues to display: leave both empty
   1.4. Click Next (and confirm you are not using a vendor)
   1.5. Fill out the second form
        - First issue publication date: 2023-01-01
        - Frequency: 1/month
        - Subscription length: issues 12
        - Subscription start date: 2023-01-01
        - Subscription end date: 2024-01-01
        - Numbering pattern: Number
        - Locale: leave empty
        - Begins with: 42
        - Inner counter: leave empty
   1.6. Click Test prediction pattern
   1.7. Click Save subscription
2. Click OPAC view: Open in new window.
   --> It should open normally in another tab/window and the record displays without problem
3. Back in the staff interface tab, receive an issue
   3.1. Click Receive
   3.2. In Status, choose Arrived for No. 42
   3.3. Click Save
4. Go back to the OPAC tab and refresh
   --> Error

I put this bug as "major", but maybe it should be higher...
Comment 1 Isabel Pineda 2023-01-30 14:33:07 UTC
Hi. I am joining this report because we are experiencing the same error in both versions Koha 22.11.01 and 22.11.02. It used to work in previous versions.
But now the OPAC shows an error page for all serial publications. 

I would like to second the request to give this bug a higher priority.

Attached please find the complete error message from the opac-error.log:

[Fri Jan 27 12:43:32.971416 2023] [cgi:error] [pid 1290861] [client 190.5.137.178:63963] AH01215: Use of uninitialized value $branch_limit in concatenation (.) or string at /usr/share/koha/lib/C4/Koha.pm line 491.: /usr/share/koha/opac/cgi-bin/opac/opac-search.pl, referer: https://biblioteca.ds.edu.sv/cgi-bin/koha/opac-detail.pl?biblionumber=20219
[Fri Jan 27 12:43:51.145215 2023] [cgi:error] [pid 1290895] [client 190.5.137.178:63979] AH01215: Template process failed: undef error - The method Koha::Serial::Item->serialseq is not covered by tests!: /usr/share/koha/opac/cgi-bin/opac/opac-detail.pl, referer: https://biblioteca.ds.edu.sv/cgi-bin/koha/opac-detail.pl?biblionumber=14374
[Fri Jan 27 12:43:51.145479 2023] [cgi:error] [pid 1290895] [client 190.5.137.178:63979] AH01215: : /usr/share/koha/opac/cgi-bin/opac/opac-detail.pl, referer: https://biblioteca.ds.edu.sv/cgi-bin/koha/opac-detail.pl?biblionumber=14374
[Fri Jan 27 12:43:51.145511 2023] [cgi:error] [pid 1290895] [client 190.5.137.178:63979] AH01215: Trace begun at /usr/share/koha/lib/Koha/Object.pm line 900: /usr/share/koha/opac/cgi-bin/opac/opac-detail.pl, referer: https://biblioteca.ds.edu.sv/cgi-bin/koha/opac-detail.pl?biblionumber=14374
[Fri Jan 27 12:43:51.145574 2023] [cgi:error] [pid 1290895] [client 190.5.137.178:63979] AH01215: Koha::Object::AUTOLOAD('Koha::Serial::Item=HASH(0x55c95cf7bd40)') called at /usr/share/koha/opac/htdocs/opac-tmpl/bootstrap/es-ES/modules/opac-detail.tt line 1327: /usr/share/koha/opac/cgi-bin/opac/opac-detail.pl, referer: https://biblioteca.ds.edu.sv/cgi-bin/koha/opac-detail.pl?biblionumber=14374
[Fri Jan 27 12:43:51.145617 2023] [cgi:error] [pid 1290895] [client 190.5.137.178:63979] AH01215: eval {...} at /usr/share/koha/opac/htdocs/opac-tmpl/bootstrap/es-ES/modules/opac-detail.tt line 1327: /usr/share/koha/opac/cgi-bin/opac/opac-detail.pl, referer: https://biblioteca.ds.edu.sv/cgi-bin/koha/opac-detail.pl?biblionumber=14374
[Fri Jan 27 12:43:51.145659 2023] [cgi:error] [pid 1290895] [client 190.5.137.178:63979] AH01215: eval {...} at /usr/share/koha/opac/htdocs/opac-tmpl/bootstrap/es-ES/modules/opac-detail.tt line 1414: /usr/share/koha/opac/cgi-bin/opac/opac-detail.pl, referer: https://biblioteca.ds.edu.sv/cgi-bin/koha/opac-detail.pl?biblionumber=14374
[Fri Jan 27 12:43:51.145694 2023] [cgi:error] [pid 1290895] [client 190.5.137.178:63979] AH01215: eval {...} at /usr/share/koha/opac/htdocs/opac-tmpl/bootstrap/es-ES/modules/opac-detail.tt line 407: /usr/share/koha/opac/cgi-bin/opac/opac-detail.pl, referer: https://biblioteca.ds.edu.sv/cgi-bin/koha/opac-detail.pl?biblionumber=14374
[Fri Jan 27 12:43:51.145741 2023] [cgi:error] [pid 1290895] [client 190.5.137.178:63979] AH01215: Template::Provider::__ANON__('Template::Context=HASH(0x55c95c580cd8)') called at /usr/lib/x86_64-linux-gnu/perl5/5.34/Template/Context.pm line 348: /usr/share/koha/opac/cgi-bin/opac/opac-detail.pl, referer: https://biblioteca.ds.edu.sv/cgi-bin/koha/opac-detail.pl?biblionumber=14374
[Fri Jan 27 12:43:51.145767 2023] [cgi:error] [pid 1290895] [client 190.5.137.178:63979] AH01215: eval {...} at /usr/lib/x86_64-linux-gnu/perl5/5.34/Template/Context.pm line 321: /usr/share/koha/opac/cgi-bin/opac/opac-detail.pl, referer: https://biblioteca.ds.edu.sv/cgi-bin/koha/opac-detail.pl?biblionumber=14374
[Fri Jan 27 12:43:51.145880 2023] [cgi:error] [pid 1290895] [client 190.5.137.178:63979] AH01215: Template::Context::process('Template::Context=HASH(0x55c95c580cd8)', 'items_table', 'HASH(0x55c95d9ef090)', 'localize me!') called at /usr/lib/x86_64-linux-gnu/perl5/5.34/Template/Context.pm line 409: /usr/share/koha/opac/cgi-bin/opac/opac-detail.pl, referer: https://biblioteca.ds.edu.sv/cgi-bin/koha/opac-detail.pl?biblionumber=14374
[Fri Jan 27 12:43:51.145948 2023] [cgi:error] [pid 1290895] [client 190.5.137.178:63979] AH01215: Template::Context::include('Template::Context=HASH(0x55c95c580cd8)', 'items_table', 'HASH(0x55c95d9ef090)') called at /usr/share/koha/opac/htdocs/opac-tmpl/bootstrap/es-ES/modules/opac-detail.tt line 531: /usr/share/koha/opac/cgi-bin/opac/opac-detail.pl, referer: https://biblioteca.ds.edu.sv/cgi-bin/koha/opac-detail.pl?biblionumber=14374
[Fri Jan 27 12:43:51.145985 2023] [cgi:error] [pid 1290895] [client 190.5.137.178:63979] AH01215: eval {...} at /usr/share/koha/opac/htdocs/opac-tmpl/bootstrap/es-ES/modules/opac-detail.tt line 18: /usr/share/koha/opac/cgi-bin/opac/opac-detail.pl, referer: https://biblioteca.ds.edu.sv/cgi-bin/koha/opac-detail.pl?biblionumber=14374
[Fri Jan 27 12:43:51.146034 2023] [cgi:error] [pid 1290895] [client 190.5.137.178:63979] AH01215: Template::Provider::__ANON__('Template::Context=HASH(0x55c95c580cd8)') called at /usr/lib/x86_64-linux-gnu/perl5/5.34/Template/Document.pm line 163: /usr/share/koha/opac/cgi-bin/opac/opac-detail.pl, referer: https://biblioteca.ds.edu.sv/cgi-bin/koha/opac-detail.pl?biblionumber=14374
[Fri Jan 27 12:43:51.146064 2023] [cgi:error] [pid 1290895] [client 190.5.137.178:63979] AH01215: eval {...} at /usr/lib/x86_64-linux-gnu/perl5/5.34/Template/Document.pm line 161: /usr/share/koha/opac/cgi-bin/opac/opac-detail.pl, referer: https://biblioteca.ds.edu.sv/cgi-bin/koha/opac-detail.pl?biblionumber=14374
[Fri Jan 27 12:43:51.146136 2023] [cgi:error] [pid 1290895] [client 190.5.137.178:63979] AH01215: Template::Document::process('Template::Document=HASH(0x55c95d5c05c8)', 'Template::Context=HASH(0x55c95c580cd8)') called at /usr/lib/x86_64-linux-gnu/perl5/5.34/Template/Context.pm line 351: /usr/share/koha/opac/cgi-bin/opac/opac-detail.pl, referer: https://biblioteca.ds.edu.sv/cgi-bin/koha/opac-detail.pl?biblionumber=14374
[Fri Jan 27 12:43:51.146168 2023] [cgi:error] [pid 1290895] [client 190.5.137.178:63979] AH01215: eval {...} at /usr/lib/x86_64-linux-gnu/perl5/5.34/Template/Context.pm line 321: /usr/share/koha/opac/cgi-bin/opac/opac-detail.pl, referer: https://biblioteca.ds.edu.sv/cgi-bin/koha/opac-detail.pl?biblionumber=14374
[Fri Jan 27 12:43:51.146286 2023] [cgi:error] [pid 1290895] [client 190.5.137.178:63979] AH01215: Template::Context::process('Template::Context=HASH(0x55c95c580cd8)', 'Template::Document=HASH(0x55c95d5c05c8)') called at /usr/lib/x86_64-linux-gnu/perl5/5.34/Template/Service.pm line 94: /usr/share/koha/opac/cgi-bin/opac/opac-detail.pl, referer: https://biblioteca.ds.edu.sv/cgi-bin/koha/opac-detail.pl?biblionumber=14374
[Fri Jan 27 12:43:51.146319 2023] [cgi:error] [pid 1290895] [client 190.5.137.178:63979] AH01215: eval {...} at /usr/lib/x86_64-linux-gnu/perl5/5.34/Template/Service.pm line 91: /usr/share/koha/opac/cgi-bin/opac/opac-detail.pl, referer: https://biblioteca.ds.edu.sv/cgi-bin/koha/opac-detail.pl?biblionumber=14374
[Fri Jan 27 12:43:51.146407 2023] [cgi:error] [pid 1290895] [client 190.5.137.178:63979] AH01215: Template::Service::process('Template::Service=HASH(0x55c95c458858)', '/usr/share/koha/opac/htdocs/opac-tmpl/bootstrap/es-ES/modules/opac-detail.tt', 'HASH(0x55c95cfcd370)') called at /usr/lib/x86_64-linux-gnu/perl5/5.34/Template.pm line 66: /usr/share/koha/opac/cgi-bin/opac/opac-detail.pl, referer: https://biblioteca.ds.edu.sv/cgi-bin/koha/opac-detail.pl?biblionumber=14374
[Fri Jan 27 12:43:51.146514 2023] [cgi:error] [pid 1290895] [client 190.5.137.178:63979] AH01215: Template::process('Template=HASH(0x55c95c4582e8)', '/usr/share/koha/opac/htdocs/opac-tmpl/bootstrap/es-ES/modules/opac-detail.tt', 'HASH(0x55c95cfcd370)', 'SCALAR(0x55c955fc7e38)') called at /usr/share/koha/lib/C4/Templates.pm line 127: /usr/share/koha/opac/cgi-bin/opac/opac-detail.pl, referer: https://biblioteca.ds.edu.sv/cgi-bin/koha/opac-detail.pl?biblionumber=14374
[Fri Jan 27 12:43:51.146587 2023] [cgi:error] [pid 1290895] [client 190.5.137.178:63979] AH01215: C4::Templates::output('C4::Templates=HASH(0x55c95c449610)') called at /usr/share/koha/opac/cgi-bin/opac/opac-detail.pl line 1249: /usr/share/koha/opac/cgi-bin/opac/opac-detail.pl, referer: https://biblioteca.ds.edu.sv/cgi-bin/koha/opac-detail.pl?biblionumber=14374
Comment 2 Isabel Pineda 2023-01-30 14:43:26 UTC
I'm sorry, the first line of the log file output was from something else.
Comment 3 Katrin Fischer 2023-01-30 15:04:43 UTC
We are also seeing this issue in our 22.11.01 test installation:

Template process failed: undef error - 
The method Koha::Serial::Item->serialseq is not covered by tests!

The OPAC view also explodes if the item has no itemtype - I know we said we won't fix all of those, but I think if we are going to make any exception, the user facing OPAC detail should be the one.
Comment 4 Tomás Cohen Arazi 2023-01-30 15:16:13 UTC
(In reply to Katrin Fischer from comment #3)
> The OPAC view also explodes if the item has no itemtype - I know we said we
> won't fix all of those, but I think if we are going to make any exception,
> the user facing OPAC detail should be the one.

Separate report.
Comment 5 Katrin Fischer 2023-01-30 16:02:38 UTC
(In reply to Tomás Cohen Arazi from comment #4)
> (In reply to Katrin Fischer from comment #3)
> > The OPAC view also explodes if the item has no itemtype - I know we said we
> > won't fix all of those, but I think if we are going to make any exception,
> > the user facing OPAC detail should be the one.
> 
> Separate report.

You are right, I should know better :)

Bug 32747 - OPAC detail page explodes for items without itemtype
Comment 6 Tomás Cohen Arazi 2023-01-30 18:41:54 UTC
Created attachment 145804 [details] [review]
Bug 32555: Fix serial vs. serialitem typo

To test:
1. Create a serial subscription
   1.1. Go to Serials
   1.2. Click on New subscription
   1.3. Fill out the first form
        - Vendor: leave empty
        - Record: enter a record number (I used 108)
        - Create an item record when receiving this serial
        - When there is an irregular issue: Keep issue number
        - Manual history: leave unchecked
        - Call number: leave empty
        - Library: Centerville
        - Public/nonpublic note: leave empty
        - Patron notification: None
        - Location: None
        - Collection: None
        - Item type: Continuing resources
        - Grace period: leave empty
        - Number of issues to display: leave both empty
   1.4. Click Next (and confirm you are not using a vendor)
   1.5. Fill out the second form
        - First issue publication date: 2023-01-01
        - Frequency: 1/month
        - Subscription length: issues 12
        - Subscription start date: 2023-01-01
        - Subscription end date: 2024-01-01
        - Numbering pattern: Number
        - Locale: leave empty
        - Begins with: 42
        - Inner counter: leave empty
   1.6. Click Test prediction pattern
   1.7. Click Save subscription
2. Click OPAC view: Open in new window.
=> SUCCESS: It should open normally in another tab/window and the record displays without problem
3. Back in the staff interface tab, receive an issue
   3.1. Click Receive
   3.2. In Status, choose Arrived for No. 42
   3.3. Click Save
4. Go back to the OPAC tab and refresh
=> FAIL: Page explodes
5. Apply this patch
6. Repeat 4
=> SUCCESS: Information shows correctly no explosions.
7. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 7 Caroline Cyr La Rose 2023-01-30 19:11:13 UTC
Created attachment 145807 [details] [review]
Bug 32555: Fix serial vs. serialitem typo

To test:
1. Create a serial subscription
   1.1. Go to Serials
   1.2. Click on New subscription
   1.3. Fill out the first form
        - Vendor: leave empty
        - Record: enter a record number (I used 108)
        - Create an item record when receiving this serial
        - When there is an irregular issue: Keep issue number
        - Manual history: leave unchecked
        - Call number: leave empty
        - Library: Centerville
        - Public/nonpublic note: leave empty
        - Patron notification: None
        - Location: None
        - Collection: None
        - Item type: Continuing resources
        - Grace period: leave empty
        - Number of issues to display: leave both empty
   1.4. Click Next (and confirm you are not using a vendor)
   1.5. Fill out the second form
        - First issue publication date: 2023-01-01
        - Frequency: 1/month
        - Subscription length: issues 12
        - Subscription start date: 2023-01-01
        - Subscription end date: 2024-01-01
        - Numbering pattern: Number
        - Locale: leave empty
        - Begins with: 42
        - Inner counter: leave empty
   1.6. Click Test prediction pattern
   1.7. Click Save subscription
2. Click OPAC view: Open in new window.
=> SUCCESS: It should open normally in another tab/window and the record displays without problem
3. Back in the staff interface tab, receive an issue
   3.1. Click Receive
   3.2. In Status, choose Arrived for No. 42
   3.3. Click Save
4. Go back to the OPAC tab and refresh
=> FAIL: Page explodes
5. Apply this patch
6. Repeat 4
=> SUCCESS: Information shows correctly no explosions.
7. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 8 Katrin Fischer 2023-01-30 23:21:33 UTC
Created attachment 145834 [details] [review]
Bug 32555: Fix serial vs. serialitem typo

To test:
1. Create a serial subscription
   1.1. Go to Serials
   1.2. Click on New subscription
   1.3. Fill out the first form
        - Vendor: leave empty
        - Record: enter a record number (I used 108)
        - Create an item record when receiving this serial
        - When there is an irregular issue: Keep issue number
        - Manual history: leave unchecked
        - Call number: leave empty
        - Library: Centerville
        - Public/nonpublic note: leave empty
        - Patron notification: None
        - Location: None
        - Collection: None
        - Item type: Continuing resources
        - Grace period: leave empty
        - Number of issues to display: leave both empty
   1.4. Click Next (and confirm you are not using a vendor)
   1.5. Fill out the second form
        - First issue publication date: 2023-01-01
        - Frequency: 1/month
        - Subscription length: issues 12
        - Subscription start date: 2023-01-01
        - Subscription end date: 2024-01-01
        - Numbering pattern: Number
        - Locale: leave empty
        - Begins with: 42
        - Inner counter: leave empty
   1.6. Click Test prediction pattern
   1.7. Click Save subscription
2. Click OPAC view: Open in new window.
=> SUCCESS: It should open normally in another tab/window and the record displays without problem
3. Back in the staff interface tab, receive an issue
   3.1. Click Receive
   3.2. In Status, choose Arrived for No. 42
   3.3. Click Save
4. Go back to the OPAC tab and refresh
=> FAIL: Page explodes
5. Apply this patch
6. Repeat 4
=> SUCCESS: Information shows correctly no explosions.
7. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 9 Jonathan Druart 2023-01-31 08:03:31 UTC
I guess this has been caused by bug 27272.
Comment 10 Tomás Cohen Arazi 2023-01-31 12:42:04 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 11 Isabel Pineda 2023-01-31 16:51:09 UTC
Thank you very much. Just one question: Is there a workaround how I can enable the serials view in the OPAC in the current version?
Comment 12 Jacob O'Mara 2023-01-31 17:46:57 UTC
Nice work, thanks everyone!

Pushed to 22.11.x for the next release.
Comment 13 David Nind 2023-02-01 17:47:56 UTC
(In reply to Isabel Pineda from comment #11)
> Thank you very much. Just one question: Is there a workaround how I can
> enable the serials view in the OPAC in the current version?

You could manually make the change to the Koha code on your server - see the diff for the bug listed under the attachments section to see what was changed to fix it. It is a change to a single line of code.

Once the next maintenance release of Koha 22.11 comes out (this would normally be near the end of February), you could reverse the change and then do the normal maintenance release upgrade.

I realise that this isn't standard practice, but needs must and all that....
Comment 14 Isabel Pineda 2023-02-01 18:10:58 UTC
(In reply to David Nind from comment #13)
> (In reply to Isabel Pineda from comment #11)
> > Thank you very much. Just one question: Is there a workaround how I can
> > enable the serials view in the OPAC in the current version?
> 
> You could manually make the change to the Koha code on your server - see the
> diff for the bug listed under the attachments section to see what was
> changed to fix it. It is a change to a single line of code.
> 
> Once the next maintenance release of Koha 22.11 comes out (this would
> normally be near the end of February), you could reverse the change and then
> do the normal maintenance release upgrade.
> 
> I realise that this isn't standard practice, but needs must and all that....


Hi David. Thank you so much. I thought that the fix would come with the release of version 22.11 in November.
I have just changed the line in the file, and now everything is working again.
Comment 15 Lucas Gass 2023-02-03 21:43:57 UTC
Missing dependencies for 22.05, no backport