Bug 28723

Summary: Holds table not displayed when it contains a biblio without title
Product: Koha Reporter: Julian Maurice <julian.maurice>
Component: Staff interfaceAssignee: Julian Maurice <julian.maurice>
Status: CLOSED FIXED QA Contact: Jonathan Druart <jonathan.druart>
Severity: normal    
Priority: P5 - low CC: arthur.suzuki, dcook, gmcharlt, jonathan.druart, joonas.kylmala, lucas, tomascohen, victor
Version: Main   
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:
22.11.00, 22.05.01, 21.11.07
Circulation function:
Attachments: Bug 28723: Fix holds table display when a biblio has no title
Bug 28723: Fix holds table display when a biblio has no title
Bug 28723: Fix holds table display when a biblio has no title
Bug 28723: Fix holds table display when a biblio has no title
Bug 28723: Replace "No title" by an empty string
Bug 28723: Fix holds table display when a biblio has no title
Bug 28723: Replace "No title" by an empty string

Description Julian Maurice 2021-07-20 12:44:15 UTC
Steps to reproduce:
1. Create a biblio without title, then create an item for this biblio.
2. Place a hold on it.
3. Go to the patron detail page and click on the Holds tab
4. Confirm that holds are not displayed (the table is there but empty)

In the browser console you can see an error message:
> Uncaught TypeError: oObj.title is null
Comment 1 Julian Maurice 2021-07-20 12:47:09 UTC Comment hidden (obsolete)
Comment 2 Julian Maurice 2021-07-20 13:48:15 UTC
Created attachment 122975 [details] [review]
Bug 28723: Fix holds table display when a biblio has no title

Test plan:
1. Create a biblio without title, then create an item for this biblio.
2. Place a hold on it.
3. Go to the patron detail page and click on the Holds tab
4. Confirm that holds are correctly displayed
Comment 3 Joonas Kylmälä 2021-07-23 10:47:21 UTC
The English text added in the patch is untranslatable, please see https://wiki.koha-community.org/wiki/Coding_Guidelines#JS5:_Enabling_translation_of_language_strings_in_linked_JavaScript
Comment 4 Julian Maurice 2022-05-30 09:00:54 UTC
Created attachment 135447 [details] [review]
Bug 28723: Fix holds table display when a biblio has no title

Test plan:
1. Create a biblio without title, then create an item for this biblio.
2. Place a hold on it.
3. Go to the patron detail page and click on the Holds tab
4. Confirm that holds are correctly displayed
Comment 5 Julian Maurice 2022-05-30 09:01:32 UTC
(In reply to Joonas Kylmälä from comment #3)
> The English text added in the patch is untranslatable
Fixed in the last patch
Comment 6 David Nind 2022-05-30 23:00:09 UTC
Created attachment 135452 [details] [review]
Bug 28723: Fix holds table display when a biblio has no title

Test plan:
1. Create a biblio without title, then create an item for this biblio.
2. Place a hold on it.
3. Go to the patron detail page and click on the Holds tab
4. Confirm that holds are correctly displayed

Signed-off-by: David Nind <david@davidnind.com>
Comment 7 Jonathan Druart 2022-05-31 06:41:20 UTC
koha-tmpl/intranet-tmpl/prog/js/checkouts.js:                              + (oObj.title ? oObj.title.escapeHtml() : '' );
koha-tmpl/intranet-tmpl/prog/js/checkouts.js:                                  + (oObj.title ? oObj.title.escapeHtml() : '' );
koha-tmpl/intranet-tmpl/prog/js/holds.js:                                  + (oObj.title ? oObj.title.escapeHtml() : __('No title'));

It's inconsistent.
Comment 8 Julian Maurice 2022-05-31 08:15:54 UTC
(In reply to Jonathan Druart from comment #7)
> It's inconsistent.
What do you suggest ? I can replace 'No title' by an empty string, but if instead we want 'No title' in checkouts.js too, that should be done in another bug IMO
biblio-title.inc uses 'No title'
Comment 9 Jonathan Druart 2022-05-31 08:25:40 UTC
I would go with the empty string for now.
Comment 10 Julian Maurice 2022-05-31 09:37:30 UTC
Created attachment 135484 [details] [review]
Bug 28723: Replace "No title" by an empty string

This is to be consistent with what is done in checkouts.js
Comment 11 Jonathan Druart 2022-05-31 09:41:30 UTC
Created attachment 135485 [details] [review]
Bug 28723: Fix holds table display when a biblio has no title

Test plan:
1. Create a biblio without title, then create an item for this biblio.
2. Place a hold on it.
3. Go to the patron detail page and click on the Holds tab
4. Confirm that holds are correctly displayed

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 12 Jonathan Druart 2022-05-31 09:41:34 UTC
Created attachment 135486 [details] [review]
Bug 28723: Replace "No title" by an empty string

This is to be consistent with what is done in checkouts.js

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 13 Tomás Cohen Arazi (tcohen) 2022-06-02 12:52:34 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 14 Lucas Gass (lukeg) 2022-06-10 15:31:31 UTC
Pushed to 22.05.x for 22.05.01
Comment 15 Arthur Suzuki 2022-06-21 12:52:46 UTC
pushed to 21.11.x for 21.11.07, thx!
Comment 16 Victor Grousset/tuxayo 2022-06-25 23:54:34 UTC
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed.

Nothing to document, marking resolved.