Problem/Motivation

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork select2-3454104

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

chr.fritsch created an issue. See original summary.

samitk’s picture

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

Thanks
Samit K.

dqd’s picture

Status: Active » Reviewed & tested by the community

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

hswong3i made their first commit to this issue’s fork.

hswong3i’s picture

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

chr.fritsch’s picture

Status: Reviewed & tested by the community » Needs work

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

ankitv18 made their first commit to this issue’s fork.

ankitv18’s picture

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

jaswinsingh’s picture

StatusFileSize
new18.14 KB

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.

sokru made their first commit to this issue’s fork.

jsacksick made their first commit to this issue’s fork.

jeroent made their first commit to this issue’s fork.

jeroent’s picture

Status: Needs work » Needs review

Tests are green again.

ankitv18’s picture

Status: Needs review » Reviewed & tested by the community

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

ruslan piskarov’s picture

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

chr.fritsch’s picture

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.

dafeder’s picture

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

heddn’s picture

Tagging

dafeder’s picture

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.

adamzimmermann’s picture

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!

dafeder’s picture

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.

mably’s picture

volkerk made their first commit to this issue’s fork.

chr.fritsch’s picture

Status: Reviewed & tested by the community » Fixed

Finally... Thx everyone for your patience

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.