- Issue 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 12:22pm 18 August 2024 - 🇫🇷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 →
- Status changed to Needs work
4 months ago 11:12am 3 September 2024 - 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 Hello,
I have created a patch for 8.x.1.15 to make it compatible with Drupal 11.
Since there is a scripting codeinfo.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.
- First commit to issue fork.
- First commit to issue fork.
- 🇮🇳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.