Commit 89ebf650 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Fixes #10641. Fehler beim Anlegen mehrerer neuen Tags gleichzeitig

parent e49044e4
Pipeline #3564 passed with stages
in 4 minutes and 31 seconds
......@@ -373,6 +373,7 @@ class Save {
// Create glue records
foreach ($result as $id => $value) {
$this->store->setVar(VAR_TAG_ID, $id, STORE_VAR);
$this->store->setVar(VAR_TAG_VALUE, $value, STORE_VAR);
......
......@@ -295,12 +295,19 @@ class FillStoreForm {
(isset($formElement[FE_PROCESS_READ_ONLY]) && $formElement[FE_PROCESS_READ_ONLY] != '0')) {
if (HelperFormElement::booleParameter($formElement[FE_TYPEAHEAD_TAG] ?? '-')) {
// TypeAhead Tags received as JSON key/value
$cntNew = 0;
// TYPEAHEAD_TAG will be delivered as JSON. Check and sanitize every key/value pair.
$arr = json_decode($clientValues[$clientFieldName], true);
$arrTmp = array();
foreach ($arr as $row) {
$arrKey = $this->doValue($formElement, $formMode, $row['key']);
// New Tags always get '0' >> make them uniq by adding a counter.
if ($arrKey == "0") {
$arrKey = "0-" . ++$cntNew;
}
$arrValue = $this->doValue($formElement, $formMode, $row['value']);
$arrTmp[$arrKey] = $arrValue;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment