Bug 11309 - Duplicated patterns when subscription table is updated
Summary: Duplicated patterns when subscription table is updated
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Serials (show other bugs)
Version: 3.14
Hardware: All All
: P5 - low normal (vote)
Assignee: Nuño López Ansótegui
QA Contact: Testopia
URL:
Keywords:
Depends on: 11261
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-26 18:20 UTC by Nuño López Ansótegui
Modified: 2014-12-07 20:07 UTC (History)
4 users (show)

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


Attachments
Bug 11309 - Duplicated patterns when subscription table is updated (2.95 KB, patch)
2013-11-26 18:22 UTC, Nuño López Ansótegui
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 11309: Duplicated patterns when subscription table is updated (3.01 KB, patch)
2014-01-08 08:19 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 11309: Duplicated patterns when subscription table is updated (3.06 KB, patch)
2014-01-17 13:30 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nuño López Ansótegui 2013-11-26 18:20:00 UTC
When you update the subscription table, checking patterns has a bad behaviour because this process compares patterns (new versus just created) without considering NULL values. The result is a lot of patterns duplicated in 'subscription_numberpatterns' table.
Comment 1 Nuño López Ansótegui 2013-11-26 18:22:27 UTC Comment hidden (obsolete)
Comment 2 Julian Maurice 2014-01-08 08:19:54 UTC Comment hidden (obsolete)
Comment 3 Julian Maurice 2014-01-08 08:29:58 UTC
Steps to reproduce the problem:
1/ Install Koha 3.12
2/ Create some subscriptions. Ensure you have at least two subscriptions with the same numbering pattern, with one of the keys everyX/addX/whenmorethanX/settoX set to NULL
3/ Remember this numbering pattern.
4/ Upgrade to 3.14
5/ Run updatedatabase.pl
6/ The numbering pattern is duplicated

Now repeat steps 1 to 4, then apply the patch and run updatedatabase.pl. Numbering pattern should not be duplicated.
Comment 4 Julian Maurice 2014-01-08 09:45:42 UTC
Maybe this need another patch to remove already created duplicates (maybe only those whose name starts with 'Backup pattern') ?
Comment 5 Kyle M Hall 2014-01-17 13:30:57 UTC
Created attachment 24495 [details] [review]
Bug 11309: Duplicated patterns when subscription table is updated

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 6 Galen Charlton 2014-05-05 03:40:41 UTC
Pushed to master.  Thanks, Nuño!