Bug 22867 - UniqueItemFields preference value should be pipe-delimited
Summary: UniqueItemFields preference value should be pipe-delimited
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Owen Leonard
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks: 22844
  Show dependency treegraph
 
Reported: 2019-05-08 13:14 UTC by Owen Leonard
Modified: 2020-06-04 20:33 UTC (History)
5 users (show)

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


Attachments
Bug 22867: UniqueItemFields preference value should be pipe-delimited (4.66 KB, patch)
2019-05-08 14:43 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 22867: UniqueItemFields preference value should be pipe-delimited (4.72 KB, patch)
2019-05-08 22:55 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 22867: UniqueItemFields preference value should be pipe-delimited (4.81 KB, patch)
2019-05-10 09:16 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 22867: (QA follow-up) Build items.json for UniqueItemFields (4.33 KB, patch)
2019-05-10 09:16 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 22867: (QA follow-up) Build items.json for UniqueItemFields (4.37 KB, patch)
2019-05-10 09:20 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 22867: Update the syspref's description in sysprefs.sql (3.22 KB, patch)
2019-05-13 13:39 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2019-05-08 13:14:21 UTC
If we implement Bug 22844, we should update the database column selection process for UniqueItemFields to match. However, UniqueItemFields is expected to contain space-delimited data rather than pipe-delimited data. This should be changed in order to make the db column selection process consistent.
Comment 1 Owen Leonard 2019-05-08 14:43:30 UTC Comment hidden (obsolete)
Comment 2 Liz Rea 2019-05-08 22:55:27 UTC Comment hidden (obsolete)
Comment 3 Marcel de Rooy 2019-05-10 09:16:33 UTC
Created attachment 89532 [details] [review]
Bug 22867: UniqueItemFields preference value should be pipe-delimited

This patch updates the UniqueItemFields system preference so that it
contains pipe-delimited data instead of space-delimited data. This makes
it consistent with other system preferences which contain lists of
database column names, and enables the selection process provided by Bug
22844.

This patch includes a database update to convert space-delimited values
in UniqueItemFields to pipe-delimited.

To test you should have two or more space-delimited items table columns
saved in the UniqueItemFields system preference. Apply the patch and run
the database update.

 - Go to Administration -> System preferences -> Acquisitions and
   confirm that the value of UniqueItemFields is now pipe-delimited.
 - Set the AcqCreateItem system preference to "placing an order."
 - Go to Acquisitions -> Vendor -> Basket -> Add to basket -> From a new
   (empty) record.
   - Fill out the item add form, including those fields specified in
     UniqueItemFields.
   - Click the "Add multiple items" button and specify one or more
     items.
   - Click "Add" and verify that in the table of items added, the fields
     specified in UniqueItemFields were not duplicated.
   - Edit one or more of those items and add duplicate values to one or
     more of the fields specified in UniqueItemFields.
   - Click "Save" and confirm that you are presented with an error
     highlighting the duplicated data.
   - Correct the data to remove the duplicates and click "Save" again.
     It should save correctly.

  - Set the AcqCreateItem system preference to "receiving an order."
  - Repeat the test above during the process of receiving an order.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Marcel de Rooy 2019-05-10 09:16:37 UTC Comment hidden (obsolete)
Comment 5 Marcel de Rooy 2019-05-10 09:20:42 UTC
Created attachment 89534 [details] [review]
Bug 22867: (QA follow-up) Build items.json for UniqueItemFields

Adding items.json, built from latest kohastructure.sql.
Control UniqueItemFields with this source file.
And add StatisticsFields.

Test plan:
Go to Preferences, play with UniqueItemFields.
Adjust StatisticsFields and look at patron record, statistics tab.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 6 Jonathan Druart 2019-05-13 13:38:13 UTC
minor: systempreferences.value still says:

623 ('UniqueItemFields','barcode','','Space-separated list of fields that should be unique (used in acquisition module for item creation). Fields must be valid SQL column names of items table','Free'),
Comment 7 Jonathan Druart 2019-05-13 13:39:20 UTC
Created attachment 89659 [details] [review]
Bug 22867: Update the syspref's description in sysprefs.sql
Comment 8 Jonathan Druart 2019-05-13 13:48:27 UTC
Owen, could you bring to the next meeting that those .json will need attention from the QA team when a field is added/renamed/removed from the DB tables?
Comment 9 Martin Renvoize 2019-06-06 15:10:44 UTC
Nice work!

Pushed to master for 19.11.00
Comment 10 Martin Renvoize 2019-06-07 06:55:29 UTC
I have reverted the QA follow-up and copied it across into bug 22844 and reversed the dependencies.  It seemed pertinent to get this consistency fix in place as it had already passed QA.