Bug 24058 - Acquisition table displayed even if no order exist (bib detail)
Summary: Acquisition table displayed even if no order exist (bib detail)
Status: Pushed to master
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Owen Leonard
QA Contact: Marcel de Rooy
URL:
Keywords: Academy
Depends on: 20366
Blocks:
  Show dependency treegraph
 
Reported: 2019-11-18 15:16 UTC by Jonathan Druart
Modified: 2019-11-26 15:08 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
19.11.00


Attachments
Bug 24058: acquisition table displayed even if no order exist (bib detail) (1.44 KB, patch)
2019-11-18 19:02 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 24058: acquisition table displayed even if no order exist (bib detail) (1.58 KB, patch)
2019-11-19 09:29 UTC, Séverine Queune
Details | Diff | Splinter Review
Bug 24058: acquisition table displayed even if no order exist (bib detail) (1.68 KB, patch)
2019-11-21 08:43 UTC, Marcel de Rooy
Details | Diff | Splinter Review

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