Bug 17808

Summary: When editing circulation conditions, only ask for confirmation when there is already a rule selected
Product: Koha Reporter: Bouzid Fergani <bouzid.fergani>
Component: CirculationAssignee: Jonathan Druart <jonathan.druart+koha>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: francois.charbonnier, gmcharlt, jonathan.druart+koha, katrin.fischer, kyle.m.hall, kyle, mtj, nick, philippe.blouin
Version: unspecified   
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:
Bug Depends on: 4354    
Bug Blocks:    
Attachments: Bug 17808: String change - message showing for rule edit confirmation
Bug 17808: Fix behavior when editing a circ rule
[SIGNED OFF] Bug 17808: Fix behavior when editing a circ rule
Bug 17808: Fix behavior when editing a circ rule

Description Bouzid Fergani 2016-12-22 14:30:53 UTC
very easy, just change string showing when edit rule
for reproduce:
   1- Administration
   2- Circulation and fines rules
   3- When try to edit any rule, you have the message :
          Are you sure you want to edit another rule?
The new message is : Are you sure you want to edit this rule ?
Comment 1 Katrin Fischer 2016-12-22 14:35:04 UTC
Hm, I feel like the bug is that it shows when you first pick a rule - it should only show when you change editing to another without saving first.
Comment 2 Bouzid Fergani 2016-12-22 14:39:15 UTC
Created attachment 58389 [details] [review]
Bug 17808: String change - message showing for rule edit confirmation
Comment 3 Katrin Fischer 2016-12-22 18:02:35 UTC
I still think the bug is not the text, it's the behaviour. I even think it used to work differently.
Comment 4 Jonathan Druart 2016-12-23 09:22:06 UTC
Created attachment 58408 [details] [review]
Bug 17808: Fix behavior when editing a circ rule

The original behavior is broken, see https://stackoverflow.com/questions/21410484/jquery-selector-to-find-out-count-of-non-empty-inputs

Test plan:
Edit a circ rule
=> Without this patch you get a useless message
=> With this patch, no message
Edit a circ rule with content in inputs
=> With or without this patch you get a useful message
Comment 5 Katrin Fischer 2017-01-07 22:10:17 UTC
Created attachment 58652 [details] [review]
[SIGNED OFF] Bug 17808: Fix behavior when editing a circ rule

The original behavior is broken, see https://stackoverflow.com/questions/21410484/jquery-selector-to-find-out-count-of-non-empty-inputs

Test plan:
Edit a circ rule
=> Without this patch you get a useless message
=> With this patch, no message
Edit a circ rule with content in inputs
=> With or without this patch you get a useful message

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Nick Clemens 2017-01-13 21:41:11 UTC
Created attachment 58983 [details] [review]
Bug 17808: Fix behavior when editing a circ rule

The original behavior is broken, see https://stackoverflow.com/questions/21410484/jquery-selector-to-find-out-count-of-non-empty-inputs

Test plan:
Edit a circ rule
=> Without this patch you get a useless message
=> With this patch, no message
Edit a circ rule with content in inputs
=> With or without this patch you get a useful message

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 7 Nick Clemens 2017-01-13 21:42:46 UTC
This is definitely an improvement but a case worth mentioning:

Change a bunch of the dropdowns and enter no other data, no warning on editing a new rule. I don't know if it would be feasible to tackle this, and the current patches offer huge improvement so marking PQA
Comment 8 Kyle M Hall 2017-01-20 13:56:22 UTC
Pushed to master for 17.05, thanks Jonathan!
Comment 9 Katrin Fischer 2017-01-22 20:09:33 UTC
This patch has been pushed to 16.11.x and will be in 16.11.02.
Comment 10 Mason James 2017-01-27 03:47:33 UTC
Pushed to 16.05.x, for 16.05.08 release