Bug 19539

Summary: Editing rules that contain 'Unlimited' values produces invalid data
Product: Koha Reporter: Tomás Cohen Arazi <tomascohen>
Component: TemplatesAssignee: Tomás Cohen Arazi <tomascohen>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: fridolin.somers, jonathan.druart
Version: Main   
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: 18857    
Bug Blocks: 15486    
Attachments: Bug 19539: Fix column index shift in cirulation rules
Bug 19539: Fix column index shift in cirulation rules
Bug 19539: Fix column index shift in cirulation rules
Bug 19539: (follow-up) Fix column index shift in cirulation rules
Bug 19539: Fix column index shift in cirulation rules
Bug 19539: (follow-up) Fix column index shift in cirulation rules
Bug 19539: (follow-up) Fix column index shift in cirulation rules

Description Tomás Cohen Arazi 2017-10-27 14:10:54 UTC
Steps to reproduce:
- On the Circulation and fine rules page
- Empty the value of 'Current on-site checkouts allowed' and save
- Notice 'Unlimited' shows on the saved rule.
- Click edit
=> FAIL: the 'Unlimited' string displays intead of the empty string.

This was introduced by bug 18857
Comment 1 Tomás Cohen Arazi 2017-10-27 14:16:04 UTC
Created attachment 68719 [details] [review]
Bug 19539: Fix column index shift in cirulation rules

This patch fixes an index shift introduced by bug 18857 when it introduced
a new column.

To test:
- On the Circulation and fine rules page
- Empty the value of 'Current on-site checkouts allowed' and save
- Notice 'Unlimited' shows on the saved rule.
- Click edit
=> FAIL: the 'Unlimited' string displays instead of the empty string on the editing row.
- Apply this patch
- Re-open the circ rules page
- Click edit
=> SUCCESS: An empty string fills the 'Unlimited' fields
- Sign off :-D
Comment 2 David Bourgault 2017-10-27 19:46:43 UTC
Created attachment 68789 [details] [review]
Bug 19539: Fix column index shift in cirulation rules

This patch fixes an index shift introduced by bug 18857 when it introduced
a new column.

To test:
- On the Circulation and fine rules page
- Empty the value of 'Current on-site checkouts allowed' and save
- Notice 'Unlimited' shows on the saved rule.
- Click edit
=> FAIL: the 'Unlimited' string displays instead of the empty string on the editing row.
- Apply this patch
- Re-open the circ rules page
- Click edit
=> SUCCESS: An empty string fills the 'Unlimited' fields
- Sign off :-D

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Comment 3 Jonathan Druart 2017-10-30 14:15:42 UTC
Created attachment 68846 [details] [review]
Bug 19539: Fix column index shift in cirulation rules

This patch fixes an index shift introduced by bug 18857 when it introduced
a new column.

To test:
- On the Circulation and fine rules page
- Empty the value of 'Current on-site checkouts allowed' and save
- Notice 'Unlimited' shows on the saved rule.
- Click edit
=> FAIL: the 'Unlimited' string displays instead of the empty string on the editing row.
- Apply this patch
- Re-open the circ rules page
- Click edit
=> SUCCESS: An empty string fills the 'Unlimited' fields
- Sign off :-D

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 Jonathan Druart 2017-10-30 14:15:46 UTC
Created attachment 68847 [details] [review]
Bug 19539: (follow-up) Fix column index shift in cirulation rules

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 5 Kyle M Hall 2017-11-01 14:45:49 UTC
Created attachment 68879 [details] [review]
Bug 19539: Fix column index shift in cirulation rules

This patch fixes an index shift introduced by bug 18857 when it introduced
a new column.

To test:
- On the Circulation and fine rules page
- Empty the value of 'Current on-site checkouts allowed' and save
- Notice 'Unlimited' shows on the saved rule.
- Click edit
=> FAIL: the 'Unlimited' string displays instead of the empty string on the editing row.
- Apply this patch
- Re-open the circ rules page
- Click edit
=> SUCCESS: An empty string fills the 'Unlimited' fields
- Sign off :-D

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 6 Kyle M Hall 2017-11-01 14:45:55 UTC
Created attachment 68880 [details] [review]
Bug 19539: (follow-up) Fix column index shift in cirulation rules

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 7 Jonathan Druart 2017-11-01 16:11:16 UTC
Created attachment 68883 [details] [review]
Bug 19539: (follow-up) Fix column index shift in cirulation rules

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 8 Jonathan Druart 2017-11-01 16:15:31 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 9 Fridolin Somers 2017-11-20 13:36:07 UTC
Bug 18857 not in 17.05.x