Session: Fix selected value in extrafield tag - refs BT#21336

pull/5043/head
christian 2 years ago
parent 378e5ab147
commit 1a8830e22b
  1. 3
      public/main/inc/ajax/extra_field.ajax.php

@ -61,6 +61,7 @@ switch ($action) {
case 'search_tags': case 'search_tags':
header('Content-Type: application/json'); header('Content-Type: application/json');
$tag = isset($_REQUEST['q']) ? (string) $_REQUEST['q'] : ''; $tag = isset($_REQUEST['q']) ? (string) $_REQUEST['q'] : '';
$byId = !empty($_REQUEST['byid']);
$extraFieldRepo = Container::getExtraFieldRepository(); $extraFieldRepo = Container::getExtraFieldRepository();
$field = $extraFieldRepo->find($fieldId); $field = $extraFieldRepo->find($fieldId);
@ -75,7 +76,7 @@ switch ($action) {
$result = []; $result = [];
foreach ($tags as $tag) { foreach ($tags as $tag) {
$result[] = [ $result[] = [
'id' => $tag->getId(), 'id' => $byId ? $tag->getId() : $tag->getTag(),
'text' => $tag->getTag(), 'text' => $tag->getTag(),
]; ];
} }

Loading…
Cancel
Save