Skip to content
Permalink
Browse files

Merge e04384c into bdd3398

  • Loading branch information...
EnnioWolsink committed Jul 14, 2019
2 parents bdd3398 + e04384c commit e18dba600873fad149051e28f55ecf9ce9cb1cd9
Showing with 1 addition and 2 deletions.
  1. +1 −2 src/Resources/views/Form/Type/sonata_type_model_autocomplete.html.twig
@@ -284,7 +284,6 @@ file that was distributed with this source code.
$(document).ajaxSuccess(function(event, xhr, settings) {
if(typeof xhr.responseJSON != 'undefined') {
if ('{{ create_url }}'.indexOf(settings.url) !== -1 && typeof xhr.responseJSON != 'string' && xhr.responseJSON.result == 'ok') {
var form = JSON.parse('{"' + decodeURI(settings.data).replace('+', ' ').replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g,'":"') + '"}');
var item = new Option(
new DOMParser().parseFromString(xhr.responseJSON.objectName, "text/html").documentElement.textContent,
xhr.responseJSON.objectId,
@@ -298,7 +297,7 @@ file that was distributed with this source code.
var data = item;
{%- endif -%}
$('#{{ id }}_hidden_inputs_wrap').html('<input type="hidden" name="{{ full_name }}" value="'+xhr.responseJSON.objectId+'" />');
$('#{{ id }}_hidden_inputs_wrap').html('<input type="hidden" name="{{ full_name ~ (multiple ? '[]' : '') }}" value="'+xhr.responseJSON.objectId+'" />');
// append to Select2
autocompleteInput.select2('data', data).append(data).trigger('change');

0 comments on commit e18dba6

Please sign in to comment.
You can’t perform that action at this time.