diff --git a/core/lib/Drupal/Core/Render/Element/FormElement.php b/core/lib/Drupal/Core/Render/Element/FormElement.php index b6d1789..4f5853a 100644 --- a/core/lib/Drupal/Core/Render/Element/FormElement.php +++ b/core/lib/Drupal/Core/Render/Element/FormElement.php @@ -126,7 +126,7 @@ public static function processAutocomplete(&$element, FormStateInterface $form_s $element['#attributes']['data-autocomplete-path'] = $path; // Provide a data attribute which stores extra Select2 configuration. - $options = isset($element['#autocomplete_options']) ? $element['#autocomplete_options'] : array(); + $options = isset($element['#autocomplete_options']) ? $element['#autocomplete_options'] : new \stdClass(); $element['#attributes']['data-autocomplete-options'] = Json::encode($options); } @@ -155,7 +155,6 @@ public static function processAutocomplete(&$element, FormStateInterface $form_s public static function processSelect2(&$element, FormStateInterface $form_state, &$complete_form) { if (!empty($element['#select2'])) { // Provide some default options. - // @todo Figure out if we need more defaults here. $configuration = array( 'width' => 'resolve', ); diff --git a/core/misc/autocomplete.js b/core/misc/autocomplete.js index 3e5d07a..4bc25f7 100644 --- a/core/misc/autocomplete.js +++ b/core/misc/autocomplete.js @@ -91,7 +91,7 @@ Drupal.behaviors.autocomplete = { attach: function (context) { // Act on textfields with the "form-autocomplete" class. - $(context).find('input.form-autocomplete').once('autocomplete') + $(context).find('[data-autocomplete-path]').once('autocomplete') .each(function () { // Merge the default options with the user-defined ones. var autocompleteOptions = $.extend({}, select2Options, JSON.parse(this.getAttribute('data-autocomplete-options'))); diff --git a/core/modules/node/src/Entity/Node.php b/core/modules/node/src/Entity/Node.php index fbffc46..4b7671f 100644 --- a/core/modules/node/src/Entity/Node.php +++ b/core/modules/node/src/Entity/Node.php @@ -378,7 +378,6 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { ->setSetting('handler', 'default') ->setDefaultValueCallback('Drupal\node\Entity\Node::getCurrentUserId') ->setTranslatable(TRUE) -// ->setCardinality(1) ->setDisplayOptions('view', array( 'label' => 'hidden', 'type' => 'author',