Bug 31056 - Unable to 'Close and export as PDF' a basket group
Summary: Unable to 'Close and export as PDF' a basket group
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Katrin Fischer
QA Contact: Testopia
URL:
Keywords: regression
: 32077 (view as bug list)
Depends on: 13614
Blocks:
  Show dependency treegraph
 
Reported: 2022-06-27 19:13 UTC by Caroline Cyr La Rose
Modified: 2023-12-28 20:43 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.04


Attachments
Bug 31056: Restore closeandprint function on basketgroups page (2.19 KB, patch)
2023-02-09 23:12 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 31056: Restore closeandprint function on basketgroups page (2.26 KB, patch)
2023-02-10 16:58 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 31056: Restore closeandprint function on basketgroups page (2.04 KB, patch)
2023-02-23 08:54 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 Caroline Cyr La Rose 2022-06-27 19:13:19 UTC
The button to 'Close and export as PDF' in the basket groups page seems to be broken.

To test:
0) Make sure to have budgets, funds, and vendors set up in the acquisitions module
1) Go to Acquisitions
2) Search for a vendor
3) Create a new basket
4) Add materials to the basket
5) Close the basket (do NOT create a basket group at this time)
6) Click on the Basket groups tab on the left
7) Create a new basket group and add the basket (do NOT check the 'close basket group' box)
8) From the open basket groups list, click 'Close and export as PDF'
--> Nothing happens

In order to export as PDF, you have to edit the basket group, check the 'Close basket group' box, save and then export as PDF.
Comment 1 Katrin Fischer 2023-02-09 23:12:29 UTC
Created attachment 146461 [details] [review]
Bug 31056: Restore closeandprint function on basketgroups page

Bug 13614 removed the basketgroup.js asset from the basket group
page. This file includes the closeandprint function used for
closing and printing the PDF from the open basket groups tab.
The patch restores just this function directly in the file where
it's needed as this is the only spot and it's only a few lines.
The rest of basketgroup.js appears unused.

To test:
* Create a basket with one or more oder lines
* Close the basket and check the checkbox to add it to a
  basket group
* Reopen the basket group from the basket groups page
* Verify the close and print only leads to a JS error and
  nothing happens
* Apply patch
* Repeat and verify you can now 'Close and print' from the
  open basket group tab
* Verify all other buttons work as expected as well
Comment 2 Caroline Cyr La Rose 2023-02-10 16:58:06 UTC
Created attachment 146507 [details] [review]
Bug 31056: Restore closeandprint function on basketgroups page

Bug 13614 removed the basketgroup.js asset from the basket group
page. This file includes the closeandprint function used for
closing and printing the PDF from the open basket groups tab.
The patch restores just this function directly in the file where
it's needed as this is the only spot and it's only a few lines.
The rest of basketgroup.js appears unused.

To test:
* Create a basket with one or more oder lines
* Close the basket and check the checkbox to add it to a
  basket group
* Reopen the basket group from the basket groups page
* Verify the close and print only leads to a JS error and
  nothing happens
* Apply patch
* Repeat and verify you can now 'Close and print' from the
  open basket group tab
* Verify all other buttons work as expected as well

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 3 Caroline Cyr La Rose 2023-02-10 16:58:22 UTC
Thanks Katrin!
Comment 4 Katrin Fischer 2023-02-10 17:11:59 UTC
(In reply to Caroline Cyr La Rose from comment #3)
> Thanks Katrin!

You are very welcome! :)
Comment 5 Jonathan Druart 2023-02-22 15:44:39 UTC
I don't understand, it's in

koha-tmpl/intranet-tmpl/prog/js/basketgroup.js:function closeandprint(bg){

You are not supposed to redefine it here.

The js file still exists, but never used

I think you may simply need to re-add it.
Comment 6 Katrin Fischer 2023-02-22 16:18:07 UTC
(In reply to Jonathan Druart from comment #5)
> I don't understand, it's in
> 
> koha-tmpl/intranet-tmpl/prog/js/basketgroup.js:function closeandprint(bg){
> 
> You are not supposed to redefine it here.
> 
> The js file still exists, but never used
> 
> I think you may simply need to re-add it.

I explained that in the commit message:

Bug 13614 removed the basketgroup.js asset from the basket group
page. This file includes the closeandprint function used for
closing and printing the PDF from the open basket groups tab.
The patch restores just this function directly in the file where
it's needed as this is the only spot and it's only a few lines.
The rest of basketgroup.js appears unused.

And I also filed bug 32935 to remove basketgroup.js.
Comment 7 Jonathan Druart 2023-02-23 08:54:26 UTC
Created attachment 147192 [details] [review]
Bug 31056: Restore closeandprint function on basketgroups page

Bug 13614 removed the basketgroup.js asset from the basket group
page. This file includes the closeandprint function used for
closing and printing the PDF from the open basket groups tab.
The patch restores just this function directly in the file where
it's needed as this is the only spot and it's only a few lines.
The rest of basketgroup.js appears unused.

To test:
* Create a basket with one or more oder lines
* Close the basket and check the checkbox to add it to a
  basket group
* Reopen the basket group from the basket groups page
* Verify the close and print only leads to a JS error and
  nothing happens
* Apply patch
* Repeat and verify you can now 'Close and print' from the
  open basket group tab
* Verify all other buttons work as expected as well

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>

JD Amended patch: fix indentation and spacing

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Jonathan Druart 2023-02-23 08:54:56 UTC
PQA as it restores the exact same function that existed already, but this sleep 3s is wrong.
Comment 9 Tomás Cohen Arazi 2023-02-27 14:42:05 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 10 Matt Blenkinsop 2023-03-01 09:51:05 UTC
Nice work everyone!

Pushed to stable for 22.11.x
Comment 11 Lucas Gass 2023-03-10 14:26:53 UTC
Missing dependencies for 22.05.x, no backport.
Comment 12 Katrin Fischer 2023-03-20 20:52:32 UTC
*** Bug 32077 has been marked as a duplicate of this bug. ***