From b9a15b047ceaebfa2ff8770706117df8c8647775 Mon Sep 17 00:00:00 2001 From: Remington Steed Date: Thu, 25 Oct 2018 08:53:32 -0400 Subject: [PATCH] LP#1778571 Fix logic error converting JS bool to DB bool Two minor bugs in the Copy Notes editor had the same cause in two separate places. The cause was forgetting to convert the checkbox status (a JavaScript bool) to the correct database format ('t' or 'f'). The resulting symptoms were buggy behavior related to the state of the "Public Note" checkbox. This commit addresses both cases mentioned in the bug report and comments. To test the buggy behavior: 1. Edit an item (e.g. click the "Edit" link from the client OPAC view). 2. Click the "Item Notes" button (near the bottom of the editor). 3. Add a new note and check the "Public Note" box. 4. Click "OK". 5. Click "Item Notes" again and notice that the "Public Note" box on your new note is no longer checked. (That's bug #1.) 6. Check "Public Note" again, click "OK", and click "Save & Exit". 7. Edit the same item again. Click "Item Notes". 8. Your note should correctly have the "Public Note" checkbox checked. 9. Uncheck the box and click "OK". Click "Save & Exit". 10. Edit the same item. Click "Item Notes". 11. Notice that your change didn't save. The "Public Note" checkbox is still checked. (That's bug #2.) To test the fixes: - Clear your browser cache. - Repeat the steps above, noticing that: - At step 5, the new note correctly has the "Public Note" checkbox checked. - At step 11, the edited note correctly has the "Public Note" checkbox unchecked. NOTE: Testing requires clearing the browser cache, since the t_copy_notes.tt2 file is fetched asynchronously by AngularJS. Signed-off-by: Remington Steed Signed-off-by: Michele Morgan Signed-off-by: Chris Sharp --- Open-ILS/src/templates/staff/cat/volcopy/t_copy_notes.tt2 | 2 +- Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/templates/staff/cat/volcopy/t_copy_notes.tt2 b/Open-ILS/src/templates/staff/cat/volcopy/t_copy_notes.tt2 index 007dbcc9e8..ff2ab0fe01 100644 --- a/Open-ILS/src/templates/staff/cat/volcopy/t_copy_notes.tt2 +++ b/Open-ILS/src/templates/staff/cat/volcopy/t_copy_notes.tt2 @@ -61,7 +61,7 @@
diff --git a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js index 0a85f4cd18..4b74018aa0 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js @@ -2092,7 +2092,7 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore , var n = new egCore.idl.acpn(); n.isnew(1); n.creator(note.creator); - n.pub(note.pub); + n.pub(note.pub ? 't' : 'f'); n.title(note.title); n.value(note.value); n.owning_copy(cp.id()); -- 2.43.2