mirror of
https://github.com/grocy/grocy.git
synced 2026-06-09 03:35:05 +00:00
Properly handle double quotes in product picker product name matching (fixes #2930)
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
### Stock
|
||||
|
||||
- The product picker now searches product names accent insensitive
|
||||
- Fixed that the product picker workflow dialog was not displayed when the entered value contained double quotes
|
||||
- Fixed that changing the location on the purchase page re-initialized the due date based on product defaults (if any)
|
||||
- Fixed that when undoing a product consume or transfer transaction, the store of the corresponding stock entry wasn't restored
|
||||
- This will only apply to new consume / transfer transactions, not when undoing transactions made before using this release
|
||||
|
||||
@@ -98,10 +98,10 @@ if (prefillProduct2)
|
||||
}
|
||||
if (typeof prefillProduct !== "undefined")
|
||||
{
|
||||
var possibleOptionElement = $("#product_id option[data-additional-searchdata*=\"" + prefillProduct + "\"]").first();
|
||||
var possibleOptionElement = $("#product_id option[data-additional-searchdata*='" + prefillProduct.replace("'", "\\'") + "']").first();
|
||||
if (possibleOptionElement.length === 0)
|
||||
{
|
||||
possibleOptionElement = $("#product_id option:contains(\"" + prefillProduct + "\")").first();
|
||||
possibleOptionElement = $("#product_id option:contains('" + prefillProduct.replace("'", "\\'") + "')").first();
|
||||
}
|
||||
|
||||
if (possibleOptionElement.length > 0)
|
||||
@@ -172,7 +172,7 @@ $('#product_id_text_input').on('blur', function (e)
|
||||
}
|
||||
else // Normal product barcode handling
|
||||
{
|
||||
possibleOptionElement = $("#product_id option[data-additional-searchdata*=\"" + input.toLowerCase() + ",\"]").first();
|
||||
possibleOptionElement = $("#product_id option[data-additional-searchdata*='" + input.toLowerCase().replace("'", "\\'") + ",']").first();
|
||||
}
|
||||
|
||||
if (GetUriParam('flow') === undefined && input.length > 0 && possibleOptionElement.length > 0)
|
||||
|
||||
Reference in New Issue
Block a user