Bugzilla – Attachment 19075 Details for
Bug 10483
check_uniqueness.pl does not work
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch
0001-Bug-10483-check_uniqueness.pl-does-not-work.patch (text/plain), 1.79 KB, created by
Fridolin Somers
on 2013-06-17 15:11:57 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2013-06-17 15:11:57 UTC
Size:
1.79 KB
patch
obsolete
>From 02f08f73dc894285cab0b64dc595d7a1ed09e956 Mon Sep 17 00:00:00 2001 >From: Fridolyn SOMERS <fridolyn.somers@biblibre.com> >Date: Mon, 17 Jun 2013 17:01:33 +0200 >Subject: [PATCH] Bug 10483 - check_uniqueness.pl does not work > >When syspref "UniqueItemFields" is defined, the item uniqueness is tested in acquisition by an Ajax call to check_uniqueness.pl. >I noticed that it does not work, item is always created without alert even on existing barcode. > >I have looked in perl debug mode and found that in check_uniqueness.pl : > my $input = new CGI; > my @field = $input->param('field'); > my @value = $input->param('value'); >@field and @value are always empty. >It is because in CGI the params are named "field[]" and "value[]". >It seems to be because of the ajax serialization of a Javascript Array. >This patch corrects this bug. > >Test plan : >- Select an existing item with barcode >- Add "barcode" to "UniqueItemFields" syspref (use space as separator for multiple values) >- Set "AcqCreateItem" syspref to "Create an item when placing an order" >- Go to an acquisition basket >- Create a new order from empty >- Enter existing barcode in item form and save >=> You get an alert that barcode already exists and order is not saved >- Enter a non-existing barcode in item form and save >=> Order and item are created >--- > acqui/check_uniqueness.pl | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/acqui/check_uniqueness.pl b/acqui/check_uniqueness.pl >index 6260048..8deb195 100755 >--- a/acqui/check_uniqueness.pl >+++ b/acqui/check_uniqueness.pl >@@ -37,8 +37,8 @@ use C4::Output; > use C4::Items; > > my $input = new CGI; >-my @field = $input->param('field'); >-my @value = $input->param('value'); >+my @field = $input->param('field[]'); >+my @value = $input->param('value[]'); > > my $r = {}; > my $i = 0; >-- >1.7.10.4 >
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 10483
:
19075
|
19184
|
19282