Drupal 11 compatibility

Created on 12 June 2024, 6 months ago

Problem/Motivation

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

2.0

Component

Miscellaneous

Created by

🇩🇪Germany chr.fritsch 🇩🇪🇪🇺🌍

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @chr.fritsch
  • Merge request !38Drupal 11 compatibility → (Open) created by chr.fritsch
  • 🇮🇳India samit.310@gmail.com

    I reviewed this there are some issues related to Facets Module, as it is not converted to Drupal 11 yet.

    Thanks
    Samit K.

  • Status changed to RTBC 4 months ago
  • 🇫🇷France dqd London | N.Y.C | Paris | Hamburg | Berlin

    Applies cleanly and upgrade status under Drupal 10.3 goes green and test install on a Drupal 11 test installation was without flawa. Regarding the scope of this issue RTBC from here +1

  • First commit to issue fork.
  • 🇭🇰Hong Kong hswong3i

    Apply this MR for D11 now with:

    ...
        "repositories": {
            "https://packages.drupal.org/8": {
                "canonical": false,
                "type": "composer",
                "url": "https://packages.drupal.org/8"
            },
            "https://drupal.org/node/3454104": {
                "canonical": false,
                "type": "vcs",
                "url": "https://git.drupalcode.org/issue/select2-3454104.git"
            },
        },
    ...
        "require": {
            "drupal/select2": "dev-3454104-drupal-11-compatibility",
        }
    ...
    

    Merged with https://www.drupal.org/node/3211796

  • Pipeline finished with Failed
    4 months ago
    Total: 823s
    #270308
  • Status changed to Needs work 4 months ago
  • 🇩🇪Germany chr.fritsch 🇩🇪🇪🇺🌍

    Tests are all failing. Far away from done...

  • First commit to issue fork.
  • 🇮🇳India ankitv18

    Hi @chr.fritsch,
    I noticed branch and MR is raised against 8.x-1.x branch and I think this needs to be raised with 2.x branch

  • Pipeline finished with Failed
    2 months ago
    Total: 338s
    #304082
  • Hello,

    I have created a patch for 8.x.1.15 to make it compatible with Drupal 11.
    Since there is a scripting code info.yml file added by the packaging script from DO. So this patch will fail to apply, We can use orakili/composer-drupal-info-file-patch-helper package that prevents patch from failing as a workaround.

  • First commit to issue fork.
  • Pipeline finished with Failed
    2 months ago
    Total: 341s
    #317087
  • First commit to issue fork.
  • Pipeline finished with Failed
    about 1 month ago
    Total: 317s
    #335323
  • First commit to issue fork.
  • Pipeline finished with Failed
    25 days ago
    Total: 217s
    #351918
  • Pipeline finished with Failed
    25 days ago
    Total: 330s
    #351920
  • Pipeline finished with Failed
    25 days ago
    Total: 352s
    #351961
  • Pipeline finished with Failed
    25 days ago
    Total: 443s
    #351970
  • Pipeline finished with Canceled
    25 days ago
    Total: 154s
    #352027
  • Pipeline finished with Failed
    25 days ago
    Total: 700s
    #352031
  • Pipeline finished with Success
    25 days ago
    Total: 318s
    #352122
  • 🇧🇪Belgium JeroenT 🇧🇪

    Tests are green again.

  • 🇮🇳India ankitv18

    Changes looks good and great to see all jobs are green now ~~ marking this one RTBC.

  • 🇺🇦Ukraine ruslan piskarov Kyiv, Ukraine

    Looks good too. We need a D11 release as soon as possible. Could the author of the module create a new release?

  • 🇩🇪Germany chr.fritsch 🇩🇪🇪🇺🌍

    Thanks for fixing the tests. I will review them soon. I am still concerned that this only works with the dev version of the select2 library, but there is nothing we can do about it.

  • 🇺🇸United States dafeder Philadelphia, PA

    Thanks chr.fritsch. Looking forward to a D11-compatible release, for now getting by with the patch plus https://github.com/mglaman/composer-drupal-lenient

  • 🇺🇸United States dafeder Philadelphia, PA

    Hmm not sure what I'm doing wrong, I have both a select2 field on a content type and use the element in a custom field, with D10 it works but with 11.0.9, after applying the patch and rebuilding I am able to install the module and add fields etc but on both custom form and content type I get a broken field and console errors:

    Uncaught TypeError: c.isArray is not a function
        _resolveLanguage https://dkan-d11.ddev.site/libraries/select2/dist/js/select2.min.js?so8ouv:2
        applyFromElement https://dkan-d11.ddev.site/libraries/select2/dist/js/select2.min.js?so8ouv:2
        e https://dkan-d11.ddev.site/libraries/select2/dist/js/select2.min.js?so8ouv:2
        d https://dkan-d11.ddev.site/libraries/select2/dist/js/select2.min.js?so8ouv:2
        select2 https://dkan-d11.ddev.site/libraries/select2/dist/js/select2.min.js?so8ouv:2
        jQuery 2
        select2 https://dkan-d11.ddev.site/libraries/select2/dist/js/select2.min.js?so8ouv:2
        attach https://dkan-d11.ddev.site/modules/contrib/select2/js/select2.js?so8ouv:60
        jQuery 2
        attach https://dkan-d11.ddev.site/modules/contrib/select2/js/select2.js?so8ouv:10
        attachBehaviors https://dkan-d11.ddev.site/core/misc/drupal.js?v=11.0.9:166
        attachBehaviors https://dkan-d11.ddev.site/core/misc/drupal.js?v=11.0.9:162
        <anonymous> https://dkan-d11.ddev.site/core/misc/drupal.init.js?v=11.0.9:32
        listener https://dkan-d11.ddev.site/core/misc/drupal.init.js?v=11.0.9:20
    select2.min.js:2:56247
    

    This happens with JS aggregation on or off.

  • 🇺🇸United States adamzimmermann

    I ran into the same issue and it stumped me as I'm not a front-end developer. Another developer on my team pointed out that Drupal 11 ships with jQuery 4, Select2 doesn't seem to support jQuery 4 yet, and the isArray method is deprecated in jQuery 4, hence the issue.

    Here are some links that provide more context:

    So we decided to go with the Tagify module/library until this is resolved.

    Hope that helps!

  • 🇺🇸United States dafeder Philadelphia, PA

    Oh silly me, that's what chr.fritsch was referring to - I needed to explicitly install the dev version of select2 from npm, which does have support for Jquery4. That's fine, although tagify looks very nice thanks for the tip, may try this at some point. Select2 JS is definitely showing its age.

Production build 0.71.5 2024