Commit 0b389369 authored by Christian Fritsch's avatar Christian Fritsch
Browse files

Resolve #3310051 "Drupal 10 compatibility"

parent 9bc91d55
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -16,7 +16,8 @@
    "Modernizr": true,
    "Popper": true,
    "Sortable": true,
    "CKEDITOR": true
    "CKEDITOR": true,
    "once": true
  },
  "rules": {
    "array-bracket-spacing": ["error", "never"],
+32 −4
Original line number Diff line number Diff line
@@ -4,9 +4,18 @@ include:

variables:
  PHP_TAG: "8.1"
  SELENIUM_CHROME_TAG: "105.0"
  # Disable default phpunit job in favor of the d9/10 variants below.
  DCI_SKIP_PHPUNIT: 1

# Set allow_failure to false so that the test fails for coding standards faults.
phpcs:
  allow_failure: false

composer:
  parallel:
    matrix:
      - DRUPAL_CORE_CONSTRAINT: [ "^9" ]
      - DRUPAL_CORE_CONSTRAINT: [ "^10" ]
  script:
    # Symlinks the project into Drupal codebase, builds composer.spoons.json, and `composer install`.
    # Override with you own script if your needs are vastly unusual.
@@ -14,11 +23,30 @@ composer:
    - bash <(curl -s https://gitlab.com/drupalspoons/composer-plugin/-/raw/master/bin/setup)
    - echo -e "\e[0Ksection_end:`date +%s`:my_2_section\r\e[0K"
    - curl -L https://github.com/select2/select2/archive/refs/tags/4.0.13.tar.gz -o select2.tar.gz
    - mkdir -p web/libraries
    - tar xzf select2.tar.gz
    - mv select2-4.0.13 web/libraries/select2
    # Download facets patch and apply it.
    - cd web/modules/contrib/facets
    - curl -L https://www.drupal.org/files/issues/2022-11-17/3310536-2.x-6.patch -o facets.patch
    - patch -p1 < facets.patch

phpunit:
  # An include of the code above, for easy reuse. See https://docs.gitlab.com/ee/ci/yaml/#extends.
  extends: .phpunit-base
.phpunit-local:
  variables:
    DCI_SKIP_PHPUNIT: 0
    SELENIUM_CHROME_TAG: "105.0"

phpunit-d9:
  dependencies:
    # This syntax comes from https://gitlab.com/gitlab-org/gitlab/-/merge_requests/82734/diffs
    - "composer: [^9]"
  extends:
    - .phpunit-base
    - .phpunit-local

phpunit-d10:
  dependencies:
    - "composer: [^10]"
  extends:
    - .phpunit-base
    - .phpunit-local
+3 −4
Original line number Diff line number Diff line
@@ -10,9 +10,8 @@
        }
    ],
    "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.x-dev",
        "drupal/search_api": "^1.28",
        "drupal/form_options_attributes": "^2.0"
    }
}
+3 −3
Original line number Diff line number Diff line
@@ -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);
+3 −4
Original line number Diff line number Diff line
@@ -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);
Loading