Bug 24058

Summary: Acquisition table displayed even if no order exist (bib detail)
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: normal    
Priority: P5 - low CC: katrin.fischer, m.de.rooy
Version: MainKeywords: Academy
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:
19.11.00
Bug Depends on: 20366    
Bug Blocks:    
Attachments: Bug 24058: acquisition table displayed even if no order exist (bib detail)
Bug 24058: acquisition table displayed even if no order exist (bib detail)
Bug 24058: acquisition table displayed even if no order exist (bib detail)

Description Jonathan Druart 2019-11-18 15:16:29 UTC
The acquisition table is displayed on the bibliographic detail page, even if the record has not been ordered.
It is caused by
  commit 43326754b110c62fbb2909eea1595656833f8c02
  Bug 20366: Add subscription info to the acq tab on the biblio detail page

The "orders" variable sent to the template switched from an arrayref to a Koha::Acquisition::Orders object.

The condition [% IF orders %] in the template is no longer correct (always true) and must be replaced with [% IF orders.count %]

Wrong display:
https://snipboard.io/wXOHLJ.jpg

Expected display:
https://snipboard.io/E8GP6K.jpg
Comment 1 Owen Leonard 2019-11-18 19:02:05 UTC
Created attachment 95523 [details] [review]
Bug 24058: acquisition table displayed even if no order exist (bib detail)

This patch corrects the template check for existence of acquisitions
data on the bibliographic detail page. Now it will correctly hide the
DataTable when there is no data.

To test, apply the patch and enable the AcquisitionDetails system
preference.

 - View the bibliographic detail page for a title which has no
   associated Acquisitions data. Under the "Acquisitions details" tab
   you should see only a message, "There is no order for this biblio."

 - View the detail page for a title which has associated Acquisitions
   data. The "Acquisitions details" tab should show the correct
   information.
Comment 2 Séverine Queune 2019-11-19 09:29:58 UTC
Created attachment 95528 [details] [review]
Bug 24058: acquisition table displayed even if no order exist (bib detail)

This patch corrects the template check for existence of acquisitions
data on the bibliographic detail page. Now it will correctly hide the
DataTable when there is no data.

To test, apply the patch and enable the AcquisitionDetails system
preference.

 - View the bibliographic detail page for a title which has no
   associated Acquisitions data. Under the "Acquisitions details" tab
   you should see only a message, "There is no order for this biblio."

 - View the detail page for a title which has associated Acquisitions
   data. The "Acquisitions details" tab should show the correct
   information.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 3 Marcel de Rooy 2019-11-21 08:43:26 UTC
Created attachment 95650 [details] [review]
Bug 24058: acquisition table displayed even if no order exist (bib detail)

This patch corrects the template check for existence of acquisitions
data on the bibliographic detail page. Now it will correctly hide the
DataTable when there is no data.

To test, apply the patch and enable the AcquisitionDetails system
preference.

 - View the bibliographic detail page for a title which has no
   associated Acquisitions data. Under the "Acquisitions details" tab
   you should see only a message, "There is no order for this biblio."

 - View the detail page for a title which has associated Acquisitions
   data. The "Acquisitions details" tab should show the correct
   information.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Martin Renvoize 2019-11-21 11:36:54 UTC
Nice work!

Pushed to master for 19.11.00