Bug 6079 - Single parentheses in currency causes order to fail when updating
Summary: Single parentheses in currency causes order to fail when updating
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial (vote)
Assignee: Bugs List
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-06 08:39 UTC by Mark G
Modified: 2015-03-25 14:12 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark G 2011-04-06 08:39:58 UTC

    
Comment 1 Mark G 2011-04-06 08:47:14 UTC
To reproduce add a currency with a single parenthesis - either left or right - and try to update an order. Adding both left and right parentheses to the currency will not cause the order update to fail.

Originally discovered because the length of field truncated to leave a single left parenthesis.
Comment 2 Jonathan Druart 2015-03-25 14:12:53 UTC
Should be fixed with the following patch:

diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm
index 0bb34c6..320169a 100644
--- a/C4/Acquisition.pm
+++ b/C4/Acquisition.pm
@@ -1269,7 +1269,7 @@ sub ModOrder {
     foreach my $orderinfokey (grep(!/ordernumber/, keys %$orderinfo)){
         # ... and skip hash entries that are not in the aqorders table
         # FIXME : probably not the best way to do it (would be better to have a correct hash)
-        next unless grep(/^$orderinfokey$/, @$colnames);
+        next unless grep(/^\Q$orderinfokey\E$/, @$colnames);
             $query .= "$orderinfokey=?, ";
             push(@params, $orderinfo->{$orderinfokey});
     }

But not sure of the consequences...