Bugzilla – Attachment 89532 Details for
Bug 22867
UniqueItemFields preference value should be pipe-delimited
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22867: UniqueItemFields preference value should be pipe-delimited
Bug-22867-UniqueItemFields-preference-value-should.patch (text/plain), 4.81 KB, created by
Marcel de Rooy
on 2019-05-10 09:16:33 UTC
(
hide
)
Description:
Bug 22867: UniqueItemFields preference value should be pipe-delimited
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2019-05-10 09:16:33 UTC
Size:
4.81 KB
patch
obsolete
>From ba87e1d905b8e96ed87890b34e5955bc228bea84 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 8 May 2019 13:21:24 +0000 >Subject: [PATCH] Bug 22867: UniqueItemFields preference value should be > pipe-delimited >Content-Type: text/plain; charset=utf-8 > >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> >--- > .../atomicupdate/bug_22867-pipe_delimited_UniqueItemFields.perl | 7 +++++++ > .../prog/en/modules/admin/preferences/acquisitions.pref | 2 +- > koha-tmpl/intranet-tmpl/prog/js/additem.js | 4 ++-- > 3 files changed, 10 insertions(+), 3 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_22867-pipe_delimited_UniqueItemFields.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_22867-pipe_delimited_UniqueItemFields.perl b/installer/data/mysql/atomicupdate/bug_22867-pipe_delimited_UniqueItemFields.perl >new file mode 100644 >index 0000000000..5ba17794b3 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_22867-pipe_delimited_UniqueItemFields.perl >@@ -0,0 +1,7 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ $dbh->do(q{UPDATE systempreferences SET value = REPLACE( value, ' ', '|' ) WHERE variable = 'UniqueItemFields'; }); >+ >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 22867 - UniqueItemFields preference value should be pipe-delimited)\n"; >+} >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref >index 44602270fd..86ffd5c5a0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref >@@ -12,7 +12,7 @@ Acquisitions: > - > - "The following <a href='http://schema.koha-community.org/__VERSION__/tables/items.html' target='blank'>database columns</a> should be unique in an item:" > - pref: UniqueItemFields >- - (separated by a space) >+ - (separate columns with |) > - > - When closing or reopening a basket, > - pref: BasketConfirmations >diff --git a/koha-tmpl/intranet-tmpl/prog/js/additem.js b/koha-tmpl/intranet-tmpl/prog/js/additem.js >index a7e93a566e..1ceedd1372 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/additem.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/additem.js >@@ -154,7 +154,7 @@ function cloneItemBlock(index, unique_item_fields, callback) { > } > var dont_copy_fields = new Array(); > if(unique_item_fields) { >- var dont_copy_fields = unique_item_fields.split(' '); >+ var dont_copy_fields = unique_item_fields.split('|'); > for(i in dont_copy_fields) { > dont_copy_fields[i] = "items." + dont_copy_fields[i]; > } >@@ -247,7 +247,7 @@ function check_additem(unique_item_fields) { > var data = new Object(); > data['field'] = new Array(); > data['value'] = new Array(); >- var array_fields = unique_item_fields.split(' '); >+ var array_fields = unique_item_fields.split('|'); > $(".order_error").empty(); // Clear error div > > // Check if a value is duplicated in form >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 22867
:
89473
|
89486
| 89532 |
89533
|
89534
|
89659