From 7181e50476db8bb7239e4a1ecf8a49f1ff109bda Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Fri, 18 Feb 2022 16:37:03 +0100 Subject: [PATCH 01/20] feat: drupal 10 --- .github/workflows/testing.yml | 4 ++-- composer.json | 6 ++---- modules/select2_facets/select2_facets.info.yml | 2 +- modules/select2_publish/select2_publish.info.yml | 2 +- select2.info.yml | 2 +- select2.module | 9 +-------- 6 files changed, 8 insertions(+), 17 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index c45e0177..768ba8d2 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -33,8 +33,8 @@ jobs: strategy: matrix: - DRUPAL_TESTING_DRUPAL_VERSION: ['~9.2.0'] - PHP_VERSION: [ '8.0' ] + DRUPAL_TESTING_DRUPAL_VERSION: ['~9.3.0', '~10.0.0'] + PHP_VERSION: [ '8.1' ] steps: - uses: actions/checkout@v2 diff --git a/composer.json b/composer.json index f8e39ae8..21590352 100644 --- a/composer.json +++ b/composer.json @@ -10,9 +10,7 @@ } ], "require-dev": { - "drupal/facets": "^2.0", - "drupal/search_api": "^1.17", - "drupal/form_options_attributes": "^1.2", - "drupal/better_exposed_filters": "^5.0" + "drupal/facets": "^2.0" + } } diff --git a/modules/select2_facets/select2_facets.info.yml b/modules/select2_facets/select2_facets.info.yml index f2b36227..ce2f3373 100644 --- a/modules/select2_facets/select2_facets.info.yml +++ b/modules/select2_facets/select2_facets.info.yml @@ -2,7 +2,7 @@ name: Select2 Facets type: module description: Provides a Select2 Facet widget. package: Search -core_version_requirement: ^9 +core_version_requirement: ^9 || ^10 dependencies: - facets:facets (>=8.x-2.0) - select2:select2 diff --git a/modules/select2_publish/select2_publish.info.yml b/modules/select2_publish/select2_publish.info.yml index a3c52a77..46fdc481 100644 --- a/modules/select2_publish/select2_publish.info.yml +++ b/modules/select2_publish/select2_publish.info.yml @@ -2,7 +2,7 @@ name: Select2 Publish type: module description: Indicates the status of referenced entities. package: User interface -core_version_requirement: ^8.8 || ^9 +core_version_requirement: ^9 || ^10 dependencies: - select2:select2 - form_options_attributes:form_options_attributes diff --git a/select2.info.yml b/select2.info.yml index c3e03eef..ee4bb6ba 100644 --- a/select2.info.yml +++ b/select2.info.yml @@ -2,4 +2,4 @@ name: Select2 type: module description: Makes entity reference fields more user-friendly using Select2. package: User interface -core_version_requirement: ^9 +core_version_requirement: ^9 || ^10 diff --git a/select2.module b/select2.module index 6f8730d7..b2975e6e 100644 --- a/select2.module +++ b/select2.module @@ -10,14 +10,7 @@ */ function select2_library_info_alter(array &$libraries, string $extension): void { if ($extension === 'select2') { - $libraries_path = 'libraries/select2'; - if (\Drupal::hasService('library.libraries_directory_file_finder')) { - $libraries_path = \Drupal::service('library.libraries_directory_file_finder')->find('select2'); - } - elseif (function_exists('libraries_get_path')) { - $libraries_path = libraries_get_path('select2'); - } - + $libraries_path = \Drupal::service('library.libraries_directory_file_finder')->find('select2'); $libraries['select2.min']['js'] = ['/' . $libraries_path . '/dist/js/select2.min.js' => ['minified' => TRUE]]; $libraries['select2.min']['css']['component'] = ['/' . $libraries_path . '/dist/css/select2.min.css' => []]; foreach (\Drupal::languageManager()->getLanguages() as $language) { From c7e0b71bf897fc9aa3d793b770b4c3cb7301bb0a Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Fri, 18 Feb 2022 16:45:10 +0100 Subject: [PATCH 02/20] fix: only 10 --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 768ba8d2..5e9161cf 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -33,7 +33,7 @@ jobs: strategy: matrix: - DRUPAL_TESTING_DRUPAL_VERSION: ['~9.3.0', '~10.0.0'] + DRUPAL_TESTING_DRUPAL_VERSION: ['~10.0.0'] PHP_VERSION: [ '8.1' ] steps: From 5a60af70466a04564b101d7235c73dea709bb365 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Wed, 9 Mar 2022 11:29:51 +0100 Subject: [PATCH 03/20] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 21590352..440e6267 100644 --- a/composer.json +++ b/composer.json @@ -11,6 +11,6 @@ ], "require-dev": { "drupal/facets": "^2.0" - + "drupal/form_options_attributes": "dev-2.x", } } From 53884a7623a00c8b3d2e6c3420050a243fddad2b Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Wed, 9 Mar 2022 11:30:13 +0100 Subject: [PATCH 04/20] Update composer.json --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 440e6267..8561a16e 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require-dev": { - "drupal/facets": "^2.0" - "drupal/form_options_attributes": "dev-2.x", + "drupal/facets": "^2.0", + "drupal/form_options_attributes": "dev-2.x" } } From f3d3cdca2a44a46f1ab1bb6b6257c63d233dc355 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Wed, 9 Mar 2022 11:31:37 +0100 Subject: [PATCH 05/20] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 8561a16e..0508c283 100644 --- a/composer.json +++ b/composer.json @@ -11,6 +11,6 @@ ], "require-dev": { "drupal/facets": "^2.0", - "drupal/form_options_attributes": "dev-2.x" + "drupal/form_options_attributes": "dev-2.0.x" } } From 9a35745912a6fba862a94f570ba5522a5273623f Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 17 Nov 2022 09:38:36 +0100 Subject: [PATCH 06/20] Update composer.json --- composer.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 0508c283..2c15e388 100644 --- a/composer.json +++ b/composer.json @@ -11,6 +11,8 @@ ], "require-dev": { "drupal/facets": "^2.0", - "drupal/form_options_attributes": "dev-2.0.x" + "drupal/search_api": "^1.28", + "drupal/form_options_attributes": "^2.0", + "drupal/better_exposed_filters": "^6.0" } } From 131708cb6b4525384cb750a1a3553a1d41e51396 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 17 Nov 2022 09:39:58 +0100 Subject: [PATCH 07/20] Rename test file --- .github/workflows/{testing.yml => test.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{testing.yml => test.yml} (100%) diff --git a/.github/workflows/testing.yml b/.github/workflows/test.yml similarity index 100% rename from .github/workflows/testing.yml rename to .github/workflows/test.yml From 6fecc25f41304d37b6a4e34a5cb1fd933b9eb950 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 17 Nov 2022 09:42:52 +0100 Subject: [PATCH 08/20] Allow plugin --- .github/workflows/test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5e9161cf..930b3366 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -65,7 +65,9 @@ jobs: restore-keys: ${{ runner.os }}-npm-cache - name: Get build environment - run: composer global require thunder/drupal-testing + run: | + composer global config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true --no-plugins + composer global require thunder/drupal-testing - name: Prepare the build run: test-drupal-project prepare_build From c23d33c0037ebae6863d6f7dfb61b604f5c48953 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 17 Nov 2022 09:51:21 +0100 Subject: [PATCH 09/20] Exclued bef --- composer.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 2c15e388..258b9806 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,6 @@ "require-dev": { "drupal/facets": "^2.0", "drupal/search_api": "^1.28", - "drupal/form_options_attributes": "^2.0", - "drupal/better_exposed_filters": "^6.0" + "drupal/form_options_attributes": "^2.0" } } From 2cbf9fdc8cc1f0248bce056aaeb49ab7b37e9fd7 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 17 Nov 2022 10:08:17 +0100 Subject: [PATCH 10/20] Set selenium version --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 930b3366..df8d44aa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,6 +17,7 @@ env: DRUPAL_TESTING_DATABASE_ENGINE: mysql DRUPAL_TESTING_HTTP_PORT: 8888 DRUPAL_TESTING_PARALLEL_TESTING: true + DRUPAL_TESTING_SELENIUM_CHROME_VERSION: 105.0 jobs: build: @@ -47,7 +48,7 @@ jobs: with: coverage: none php-version: ${{ matrix.PHP_VERSION }} - extensions: Imagick, gd, pdo_mysql + extensions: :sodium, Imagick, gd, PDO, mysql, pdo_mysql, mbstring, xmlwriter, pdo, date, dom, filter, hash, json, pcre, session, SimpleXML, SPL, tokenizer, xml, curl - name: Cache composer dependencies uses: actions/cache@v1 From 7352d153ec253d37070d68be43b10d842ca3b0d8 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 17 Nov 2022 10:10:39 +0100 Subject: [PATCH 11/20] fix string --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index df8d44aa..1e490ce3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ env: DRUPAL_TESTING_DATABASE_ENGINE: mysql DRUPAL_TESTING_HTTP_PORT: 8888 DRUPAL_TESTING_PARALLEL_TESTING: true - DRUPAL_TESTING_SELENIUM_CHROME_VERSION: 105.0 + DRUPAL_TESTING_SELENIUM_CHROME_VERSION: "105.0" jobs: build: From 407d01a90972da47f1797e464465d4ef62efdba2 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 17 Nov 2022 10:34:25 +0100 Subject: [PATCH 12/20] Replacing jquery.once --- js/select2.js | 6 +++--- modules/select2_facets/js/select2-widget.js | 7 +++---- select2.libraries.yml | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/js/select2.js b/js/select2.js index 8aaec4c6..48dfbf46 100644 --- a/js/select2.js +++ b/js/select2.js @@ -2,12 +2,12 @@ * @file * Select2 integration. */ -(function ($, drupalSettings, Sortable) { +(function ($, drupalSettings, Sortable, once) { 'use strict'; Drupal.behaviors.select2 = { attach: function (context) { - $('.select2-widget', context).once('select2-init').each(function () { + $(once('select2-init', '.select2-widget', context)).each(function () { var config = $(this).data('select2-config'); config.createTag = function (params) { var term = $.trim(params.term); @@ -77,4 +77,4 @@ } }; -})(jQuery, drupalSettings, Sortable); +})(jQuery, drupalSettings, Sortable, once); diff --git a/modules/select2_facets/js/select2-widget.js b/modules/select2_facets/js/select2-widget.js index 20e4e06a..dd5e9e2b 100644 --- a/modules/select2_facets/js/select2-widget.js +++ b/modules/select2_facets/js/select2-widget.js @@ -3,7 +3,7 @@ * Init select2 widget. */ -(function ($, Drupal) { +(function ($, Drupal, once) { 'use strict'; @@ -13,8 +13,7 @@ * Add event handler to all select2 widgets. */ Drupal.facets.initSelect2 = function () { - $('.js-facets-select2.js-facets-widget') - .once('js-facets-select2-widget-on-selection-change') + $(once('js-facets-select2-widget-on-selection-change', '.js-facets-select2.js-facets-widget')) .each(function () { var $select2_widget = $(this); @@ -37,4 +36,4 @@ } }; -})(jQuery, Drupal); +})(jQuery, Drupal, once); diff --git a/select2.libraries.yml b/select2.libraries.yml index 30f45510..9fb5fb7e 100644 --- a/select2.libraries.yml +++ b/select2.libraries.yml @@ -17,5 +17,5 @@ select2.min: component: /libraries/select2/dist/css/select2.min.css: {} dependencies: - - core/jquery.once + - core/once - core/drupal From 4b5337822fa7d1f2878b0ef5844f401b6a365717 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 17 Nov 2022 10:54:13 +0100 Subject: [PATCH 13/20] Start fixing tests --- .eslintrc | 3 ++- select2.libraries.yml | 3 ++- tests/src/FunctionalJavascript/Form/ElementTest.php | 12 ++++++------ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.eslintrc b/.eslintrc index b1cd7fd3..176b1fe9 100644 --- a/.eslintrc +++ b/.eslintrc @@ -16,7 +16,8 @@ "Modernizr": true, "Popper": true, "Sortable": true, - "CKEDITOR": true + "CKEDITOR": true, + "once": true }, "rules": { "array-bracket-spacing": ["error", "never"], diff --git a/select2.libraries.yml b/select2.libraries.yml index 9fb5fb7e..36a0579a 100644 --- a/select2.libraries.yml +++ b/select2.libraries.yml @@ -17,5 +17,6 @@ select2.min: component: /libraries/select2/dist/css/select2.min.css: {} dependencies: - - core/once - core/drupal + - core/jquery + - core/once diff --git a/tests/src/FunctionalJavascript/Form/ElementTest.php b/tests/src/FunctionalJavascript/Form/ElementTest.php index e4588a53..a26a4a56 100644 --- a/tests/src/FunctionalJavascript/Form/ElementTest.php +++ b/tests/src/FunctionalJavascript/Form/ElementTest.php @@ -62,18 +62,18 @@ public function testAjaxCallbacksInBetween(): void { } /** - * Test loading of seven theme style. + * Test loading of claro theme style. */ - public function testSevenTheme(): void { - $this->container->get('theme_installer')->install(['seven']); + public function testClaroTheme(): void { + $this->container->get('theme_installer')->install(['claro']); $this->config('system.theme') - ->set('default', 'seven') - ->set('admin', 'seven') + ->set('default', 'claro') + ->set('admin', 'claro') ->save(); $this->drupalGet('/select2-optgroup-form'); - $this->assertSession()->elementExists('css', '.select2-container--seven'); + $this->assertSession()->elementExists('css', '.select2-container--claro'); $select2_js = $this->xpath("//script[contains(@src, 'select2/js/select2.js')]"); $this->assertEquals(1, count($select2_js)); From a280e7a1d8021fb887aa0b75aa0d8871b1e86e2e Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 17 Nov 2022 11:15:52 +0100 Subject: [PATCH 14/20] Fix query get --- src/Controller/EntityAutocompleteController.php | 2 +- .../FieldWidget/Select2EntityReferenceWidgetTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Controller/EntityAutocompleteController.php b/src/Controller/EntityAutocompleteController.php index 6dc172d4..622434bd 100644 --- a/src/Controller/EntityAutocompleteController.php +++ b/src/Controller/EntityAutocompleteController.php @@ -86,7 +86,7 @@ public function handleAutocomplete(Request $request, string $target_type, string // key/value store. throw new AccessDeniedHttpException(); } - $matches['results'] = $this->matcher->getMatches($target_type, $selection_handler, $selection_settings, mb_strtolower($input), $request->query->get('selected', [])); + $matches['results'] = $this->matcher->getMatches($target_type, $selection_handler, $selection_settings, mb_strtolower($input), $request->query->has('selected') ? $request->query->all('selected') : []); } return new JsonResponse($matches); diff --git a/tests/src/FunctionalJavascript/FieldWidget/Select2EntityReferenceWidgetTest.php b/tests/src/FunctionalJavascript/FieldWidget/Select2EntityReferenceWidgetTest.php index 53281e6d..2b55d22d 100644 --- a/tests/src/FunctionalJavascript/FieldWidget/Select2EntityReferenceWidgetTest.php +++ b/tests/src/FunctionalJavascript/FieldWidget/Select2EntityReferenceWidgetTest.php @@ -391,7 +391,7 @@ public function testAutocompleteOrdering(): void { $settings = Json::decode($this->getSession()->getPage()->findField('select2')->getAttribute('data-select2-config')); $url = Url::fromUserInput($settings['ajax']['url']); - $url->setAbsolute(TRUE); + $url->setAbsolute(); $url->setRouteParameter('q', 'f'); $response = \Drupal::httpClient()->get($url->toString()); From c688c520abdd06378eac60663bedd21f8471d351 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 17 Nov 2022 11:42:38 +0100 Subject: [PATCH 15/20] Try facets --- .../tests/src/FunctionalJavascript/FacetsTest.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/select2_facets/tests/src/FunctionalJavascript/FacetsTest.php b/modules/select2_facets/tests/src/FunctionalJavascript/FacetsTest.php index c682524b..a6f433fb 100644 --- a/modules/select2_facets/tests/src/FunctionalJavascript/FacetsTest.php +++ b/modules/select2_facets/tests/src/FunctionalJavascript/FacetsTest.php @@ -69,7 +69,7 @@ public function testBasicFunctionality(array $config, array $expected_settings): $settings = $this->getSession()->getPage()->findField('Referenced[]')->getAttribute('data-select2-config'); foreach ($expected_settings as $key => $value) { - if ($key == 'ajax') { + if ($key === 'ajax') { $this->assertArrayHasKey($key, Json::decode($settings)); } else { @@ -85,14 +85,16 @@ public function testBasicFunctionality(array $config, array $expected_settings): $this->assertNotEmpty($assert_session->waitForElement('xpath', '//li[@class="select2-results__option" and text()="Reference 2"]')); $page->find('xpath', '//li[@class="select2-results__option" and text()="Reference 2"]')->click(); - $assert_session->addressEquals('test-entity-view?f%5B0%5D=referenced%3A2'); + $current_url = $this->getSession()->getCurrentUrl(); + $this->assertStringContainsString('f%5B0%5D=referenced%3A2', $current_url); $this->click('.form-item-referenced .select2-selection.select2-selection--multiple'); $page->find('css', '.select2-search__field')->setValue('Reference'); $this->assertNotEmpty($assert_session->waitForElement('xpath', '//li[@class="select2-results__option" and text()="Reference 1"]')); $page->find('xpath', '//li[@class="select2-results__option" and text()="Reference 1"]')->click(); - $assert_session->addressEquals('test-entity-view?f%5B0%5D=referenced%3A2&f%5B1%5D=referenced%3A1'); + $current_url = $this->getSession()->getCurrentUrl(); + $this->assertStringContainsString('f%5B0%5D=referenced%3A1&f%5B1%5D=referenced%3A2', $current_url); } /** @@ -104,7 +106,7 @@ public function testBasicFunctionality(array $config, array $expected_settings): public function providerTestBasicFunctionality(): array { return [ [[], ['tags' => FALSE]], - [['autocomplete' => TRUE], ['ajax' => [], 'tags' => FALSE]], + // [['autocomplete' => TRUE], ['ajax' => [], 'tags' => FALSE]], ]; } From ef5c8e2922cbd1f3e226333f519ba5325b66261f Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 17 Nov 2022 12:02:30 +0100 Subject: [PATCH 16/20] Facets dev --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 258b9806..632be884 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require-dev": { - "drupal/facets": "^2.0", + "drupal/facets": "2.0.x-dev", "drupal/search_api": "^1.28", "drupal/form_options_attributes": "^2.0" } From 17158acbf56279decf743cb620fc6b526f0eb40f Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 17 Nov 2022 13:41:59 +0100 Subject: [PATCH 17/20] Add facets patch --- composer.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/composer.json b/composer.json index 632be884..ebc2ec2b 100644 --- a/composer.json +++ b/composer.json @@ -13,5 +13,12 @@ "drupal/facets": "2.0.x-dev", "drupal/search_api": "^1.28", "drupal/form_options_attributes": "^2.0" + }, + "extra": { + "patches": { + "drupal/facets": { + "InvalidArgumentException: Expected a scalar value as a 2nd argument to \"Symfony\\Component\\HttpFoundation\\InputBag::get()\", \"array\" given": "https://www.drupal.org/files/issues/2022-11-17/3310536-2.x-6.patch" + } + } } } From f293c2cf1ababc200dbc744a8bb319543c14ccac Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 17 Nov 2022 13:53:09 +0100 Subject: [PATCH 18/20] Use thunder namespace --- .github/workflows/reviewdog.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index b35461ed..5d96f96e 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v1 - name: phpcs - uses: chrfritsch/action-drupal-coder@v1 + uses: thunder/action-drupal-coder@v1 with: github_token: ${{ secrets.github_token }} level: error From 78e2e85a57fd30967a5daa9043ddedfe13ac9948 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 17 Nov 2022 14:11:13 +0100 Subject: [PATCH 19/20] empty From a9cbf56ed1ae9dcf69135fb13bdbfaa2bf5766e1 Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 17 Nov 2022 14:24:44 +0100 Subject: [PATCH 20/20] Add endcode --- .../tests/src/FunctionalJavascript/FacetsTest.php | 2 +- src/Element/Select2.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/select2_facets/tests/src/FunctionalJavascript/FacetsTest.php b/modules/select2_facets/tests/src/FunctionalJavascript/FacetsTest.php index a6f433fb..f395f6fd 100644 --- a/modules/select2_facets/tests/src/FunctionalJavascript/FacetsTest.php +++ b/modules/select2_facets/tests/src/FunctionalJavascript/FacetsTest.php @@ -106,7 +106,7 @@ public function testBasicFunctionality(array $config, array $expected_settings): public function providerTestBasicFunctionality(): array { return [ [[], ['tags' => FALSE]], - // [['autocomplete' => TRUE], ['ajax' => [], 'tags' => FALSE]], + [['autocomplete' => TRUE], ['ajax' => [], 'tags' => FALSE]], ]; } diff --git a/src/Element/Select2.php b/src/Element/Select2.php index 8fb2af81..27b3bf55 100644 --- a/src/Element/Select2.php +++ b/src/Element/Select2.php @@ -38,6 +38,7 @@ * '3' => $this->t('Three'), * ], * ]; + * @endcode * * If you want to prevent the rendering of all options and fetch the options via * ajax instead, you can use the '#autocomplete' property. It's also needed to @@ -60,6 +61,7 @@ * 'target_bundles' => ['article', 'page'], * ], * ]; + * @endcode * * If you want to allow an input of an entity label that does not exist yet but * can be created "on the fly" on form submission, the '#autocreate' property @@ -78,6 +80,7 @@ * 'uid' => , * ], * ]; + * @endcode * * The render element sets a bunch of default values to configure the select2 * element. Nevertheless all select2 config values can be overwritten with the @@ -89,6 +92,7 @@ * 'allowClear' => TRUE, * ], * ]; + * @endcode * * @see https://select2.org/configuration/options-api *