Bug 22867: UniqueItemFields preference value should be pipe-delimited
authorOwen Leonard <oleonard@myacpl.org>
Wed, 8 May 2019 13:21:24 +0000 (13:21 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 6 Jun 2019 15:08:47 +0000 (16:08 +0100)
commit8c3890462750eb2b874da8afbd0e4899b11e3c42
treed447bbb8e1030f9ae54490cbd1263ecf756717c9
parentf3358e97c8a1f9edf1c4de6dea46f70366237699
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>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
installer/data/mysql/atomicupdate/bug_22867-pipe_delimited_UniqueItemFields.perl [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref
koha-tmpl/intranet-tmpl/prog/js/additem.js