Properly handle double quotes in product picker product name matching (fixes #2930)

This commit is contained in:
Bernd Bestel
2026-06-05 17:58:22 +02:00
parent e3d7b82204
commit c0a9d615fa
2 changed files with 4 additions and 3 deletions

View File

@@ -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

View File

@@ -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)