Bug 21186 - Incorrect Bootstrap modal event name in multiple templates
Summary: Incorrect Bootstrap modal event name in multiple templates
Status: RESOLVED FIXED
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: Testopia
URL:
Keywords:
: 21664 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-08-08 19:03 UTC by Owen Leonard
Modified: 2018-12-05 15:17 UTC (History)
6 users (show)

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


Attachments
Bug 21186: Incorrect Bootstrap modal event name in multiple templates (10.60 KB, patch)
2018-08-09 15:55 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 21186: Incorrect Bootstrap modal event name in multiple templates (10.74 KB, patch)
2018-09-04 16:00 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 21186: (follow-up) Incorrect Bootstrap modal event name in multiple templates (3.45 KB, patch)
2018-10-25 15:37 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 21186: Incorrect Bootstrap modal event name in multiple templates (10.85 KB, patch)
2018-10-25 17:34 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 21186: (follow-up) Incorrect Bootstrap modal event name in multiple templates (3.52 KB, patch)
2018-10-25 17:34 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 21186: Incorrect Bootstrap modal event name in multiple templates (10.91 KB, patch)
2018-10-27 20:49 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 21186: (follow-up) Incorrect Bootstrap modal event name in multiple templates (3.58 KB, patch)
2018-10-27 20:49 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 Owen Leonard 2018-08-08 19:03:04 UTC
When we upgraded Bootstrap in the staff client we missed updating some references to Bootstrap's "hidden" event. It should now be "hidden.bs.modal."

$("#marcPreview").on("hidden.bs.modal", function(){
    // Action triggered when modal is closed
});
Comment 1 Owen Leonard 2018-08-09 15:55:09 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2018-09-04 16:00:15 UTC
Created attachment 78412 [details] [review]
Bug 21186: Incorrect Bootstrap modal event name in multiple templates

Modals in the staff client which load data via AJAX require an "on
close" action in order to clear the modal of the loaded data. The
problem presents itself the second time the modal is opened: The
"loading" message doesn't appear, and the data from the previous link
is shown until the new data loads.

To test, apply the patch and test the following pages. In each case,
click multiple instances of the modal trigger link/button to confirm
that the "loading" message always appears between re-displays of the
modal.

- Acquisitions -> Vendor -> Add to basket -> From a staged file -> Add orders
  - Test the "MARC" and "Card" links
- Acquisitions -> EDIFACT messages
  - Test the "View message" button
- Acquisitions -> Vendor -> Add to basket -> From an existing record
  - Test "View MARC" link
- Acquisitions -> Vendor -> Invoices -> Invoice -> Receipt page
  - Test the "Order," "MARC," and "Card" links.
- Catalog -> Bibliographic record details
  - Test the MARC Preview link.
- Cataloging -> Cataloging search results
  - Test the Actions -> MARC preview and Actions -> Card preview menu
    items
- Cataloging -> Cataloging search results -> Merge
  - Test the "View MARC" linkscataloguing/merge.tt
- Tools -> Patron lists -> Actions -> Print patron cards
- Tools -> Batch record modification -> Results -> Show MARC
- Tools -> Staged MARC record management -> View batch
  - Test MARC preview shown when you click a staged title
Comment 3 M. Tompsett 2018-09-06 17:11:10 UTC
Just to confirm Owen's bug report:
https://getbootstrap.com/2.3.2/javascript.html#modals
(just "hidden")
vs.
https://getbootstrap.com/docs/3.3/javascript/#modals-events
and
https://getbootstrap.com/docs/4.0/components/modal/#events
("hidden.bs.modal")

Eye balls fine, but have not tested it.
Comment 4 Owen Leonard 2018-10-25 15:16:53 UTC
*** Bug 21664 has been marked as a duplicate of this bug. ***
Comment 5 Owen Leonard 2018-10-25 15:37:42 UTC
Created attachment 81182 [details] [review]
Bug 21186: (follow-up) Incorrect Bootstrap modal event name in multiple templates

This patch addresses a few more instances of this problem which I didn't
catch in my first pass.

To test, apply the patch and clear your browser cache if necessary.

- Go to Circulation -> Check in and check in an item which has a hold.
  - When the 'Hold found' modal appears the checkin barcode field
    behind it should be disabled.
  - When the modal is dismissed the checkin field should be enabled
    again and focus should be on that field.

- Go to Administration -> Library groups.
  - Click the "Add group" button. The cursor focus should be on the
    title field.

- Go to Tools -> MARC modification templates.
  - Click the "New template" button. The cursor focus should be on the
    name field.
Comment 6 Cori Lynn Arnold 2018-10-25 16:41:16 UTC
Trying to sign off, but I don't know how to trigger some of these tests:

Acquisitions -> Vendor -> Add to basket -> From a staged file -> Add orders
  - Test the "MARC" and "Card" links
  DONE
  
- Acquisitions -> EDIFACT messages
  - Test the "View message" button
  DON'T KNOW HOW TO GET EDIFACT MESSAGES
  
- Acquisitions -> Vendor -> Add to basket -> From an existing record
  - Test "View MARC" link
  DONE
  
- Acquisitions -> Vendor -> Invoices -> Invoice -> Receipt page
  - Test the "Order," "MARC," and "Card" links.
  DON'T KNOW HOW TO GET INVOICES 
  
- Catalog -> Bibliographic record details
  - Test the MARC Preview link.
   DONE
  
  
- Cataloging -> Cataloging search results
  - Test the Actions -> MARC preview and Actions -> Card preview menu
    items
	DONE
	
- Cataloging -> Cataloging search results -> Merge
  - Test the "View MARC" linkscataloguing/merge.tt
  DON'T KNOW HOW TO MAKE THIS HAPPEN
  
- Tools -> Patron lists -> Actions -> Print patron cards
	DONE
	
- Tools -> Batch record modification -> Results -> Show MARC
	DONE

- Tools -> Staged MARC record management -> View batch
  - Test MARC preview shown when you click a staged title
    DONE

- Go to Circulation -> Check in and check in an item which has a hold.
  - When the 'Hold found' modal appears the checkin barcode field
    behind it should be disabled.
  - When the modal is dismissed the checkin field should be enabled
    again and focus should be on that field.
   DONE

- Go to Administration -> Library groups.
  - Click the "Add group" button. The cursor focus should be on the
    title field.
   DONE

- Go to Tools -> MARC modification templates.
  - Click the "New template" button. The cursor focus should be on the
    name field.
    DONE
Comment 7 ByWater Sandboxes 2018-10-25 17:34:35 UTC
Created attachment 81189 [details] [review]
Bug 21186: Incorrect Bootstrap modal event name in multiple templates

Modals in the staff client which load data via AJAX require an "on
close" action in order to clear the modal of the loaded data. The
problem presents itself the second time the modal is opened: The
"loading" message doesn't appear, and the data from the previous link
is shown until the new data loads.

To test, apply the patch and test the following pages. In each case,
click multiple instances of the modal trigger link/button to confirm
that the "loading" message always appears between re-displays of the
modal.

- Acquisitions -> Vendor -> Add to basket -> From a staged file -> Add orders
  - Test the "MARC" and "Card" links
- Acquisitions -> EDIFACT messages
  - Test the "View message" button
- Acquisitions -> Vendor -> Add to basket -> From an existing record
  - Test "View MARC" link
- Acquisitions -> Vendor -> Invoices -> Invoice -> Receipt page
  - Test the "Order," "MARC," and "Card" links.
- Catalog -> Bibliographic record details
  - Test the MARC Preview link.
- Cataloging -> Cataloging search results
  - Test the Actions -> MARC preview and Actions -> Card preview menu
    items
- Cataloging -> Cataloging search results -> Merge
  - Test the "View MARC" linkscataloguing/merge.tt
- Tools -> Patron lists -> Actions -> Print patron cards
- Tools -> Batch record modification -> Results -> Show MARC
- Tools -> Staged MARC record management -> View batch
  - Test MARC preview shown when you click a staged title

Signed-off-by: Cori Lynn Arnold <carnold@dgiinc.com>
Comment 8 ByWater Sandboxes 2018-10-25 17:34:38 UTC
Created attachment 81190 [details] [review]
Bug 21186: (follow-up) Incorrect Bootstrap modal event name in multiple templates

This patch addresses a few more instances of this problem which I didn't
catch in my first pass.

To test, apply the patch and clear your browser cache if necessary.

- Go to Circulation -> Check in and check in an item which has a hold.
  - When the 'Hold found' modal appears the checkin barcode field
    behind it should be disabled.
  - When the modal is dismissed the checkin field should be enabled
    again and focus should be on that field.

- Go to Administration -> Library groups.
  - Click the "Add group" button. The cursor focus should be on the
    title field.

- Go to Tools -> MARC modification templates.
  - Click the "New template" button. The cursor focus should be on the
    name field.

Signed-off-by: Cori Lynn Arnold <carnold@dgiinc.com>
Comment 9 Cori Lynn Arnold 2018-10-25 17:35:02 UTC
signed off
Comment 10 Katrin Fischer 2018-10-27 20:49:36 UTC
Created attachment 81369 [details] [review]
Bug 21186: Incorrect Bootstrap modal event name in multiple templates

Modals in the staff client which load data via AJAX require an "on
close" action in order to clear the modal of the loaded data. The
problem presents itself the second time the modal is opened: The
"loading" message doesn't appear, and the data from the previous link
is shown until the new data loads.

To test, apply the patch and test the following pages. In each case,
click multiple instances of the modal trigger link/button to confirm
that the "loading" message always appears between re-displays of the
modal.

- Acquisitions -> Vendor -> Add to basket -> From a staged file -> Add orders
  - Test the "MARC" and "Card" links
- Acquisitions -> EDIFACT messages
  - Test the "View message" button
- Acquisitions -> Vendor -> Add to basket -> From an existing record
  - Test "View MARC" link
- Acquisitions -> Vendor -> Invoices -> Invoice -> Receipt page
  - Test the "Order," "MARC," and "Card" links.
- Catalog -> Bibliographic record details
  - Test the MARC Preview link.
- Cataloging -> Cataloging search results
  - Test the Actions -> MARC preview and Actions -> Card preview menu
    items
- Cataloging -> Cataloging search results -> Merge
  - Test the "View MARC" linkscataloguing/merge.tt
- Tools -> Patron lists -> Actions -> Print patron cards
- Tools -> Batch record modification -> Results -> Show MARC
- Tools -> Staged MARC record management -> View batch
  - Test MARC preview shown when you click a staged title

Signed-off-by: Cori Lynn Arnold <carnold@dgiinc.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Katrin Fischer 2018-10-27 20:49:41 UTC
Created attachment 81370 [details] [review]
Bug 21186: (follow-up) Incorrect Bootstrap modal event name in multiple templates

This patch addresses a few more instances of this problem which I didn't
catch in my first pass.

To test, apply the patch and clear your browser cache if necessary.

- Go to Circulation -> Check in and check in an item which has a hold.
  - When the 'Hold found' modal appears the checkin barcode field
    behind it should be disabled.
  - When the modal is dismissed the checkin field should be enabled
    again and focus should be on that field.

- Go to Administration -> Library groups.
  - Click the "Add group" button. The cursor focus should be on the
    title field.

- Go to Tools -> MARC modification templates.
  - Click the "New template" button. The cursor focus should be on the
    name field.

Signed-off-by: Cori Lynn Arnold <carnold@dgiinc.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Nick Clemens 2018-10-29 01:18:59 UTC
Awesome work all!

Pushed to master for 18.11
Comment 13 Martin Renvoize 2018-11-08 15:42:37 UTC
Pushed to 18.05.x for 18.05.06
Comment 14 Fridolin SOMERS 2018-11-28 10:52:20 UTC
Is this also for 17.11.x ?
Comment 15 Owen Leonard 2018-11-28 12:45:02 UTC
(In reply to Fridolin SOMERS from comment #14)
> Is this also for 17.11.x ?

Yes.
Comment 16 Fridolin SOMERS 2018-11-29 10:52:14 UTC
Pushed to 17.11.x for 17.11.13