New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP - Upgrade Select2 to version 4 #20825
Conversation
(Standard links)
|
@monishdeb I've rebased the work you did in #11969 to give it another try and see how far we can get. So far, clicking around I see multiple problems and console errors, so there's more work to do. I'll keep this PR as a draft for now; feel free to jump in with additional commits (you can create a PR against this PR by checking out my branch and pushing it to your fork). |
@monishdeb could you work on this with @colemanw over the next little while to try to complete? There are some compatibility layers that he has found that should help. |
Thanks @colemanw for putting this PR. Yes, I'll make the additional changes on my branch and I am hoping you can help me with some compatibility issues which I was unable to fix earlier :( |
(afform tangent) I tested on top of 5.40 and things did not dramatically explode, which is cool (it's a big upgrade and presumably a lot of work went into this). I had run into a bug with afform on WordPress, where select2 is broken if we are using a recent block theme, such as TwentyTwentyOne (older themes work fine). I will try to open a bug elsewhere, but since Eileen pointed me to this PR, I just wanted to say that it does seem to help on WP. Edit: opened a separate bug for afform: https://lab.civicrm.org/dev/core/-/issues/2688 |
Thanks, @mlutfy for reporting the issue, will try&fix the bug while working on the compatibility issues. I am pretty sure this is one of those issues which I haven't addressed yet but yeah, I'll let you know when it's fixed. |
I've been trying to get EntityRef fields working, with discouraging results. Based on my testing, the 4.0.x series of Select2 maintains limited support for I've tested several different versions of Select2 (4.0.0, 4.0.5, 4.0.10) and all give the same results - the This would be a deal-breaker if we can't find a way to get that working. Yes, it would be good to transition our EntityRef field markup to use Just to be sure I'm not missing something, @monishdeb did you ever get EntityRef fields working? @mlutfy when you say "things did not dramatically explode" did you test any EntityRef fields? |
@colemanw sorry for the delayed response. No, I wasn't able to get the entityRef part resolved (using |
I wrote directly to the author of select2, @kevin-brown and he was kind enough to reply and confirm that I see 2 paths forward:
Personally, I lean toward option 2 because both options require a lot of work, but the second option retires technical debt while the 1st just pays interest on the debt. |
We at AGH are interested in moving this forward and can contribute time reviewing/testing when the time comes. |
This has conflicts and has been unworked on for several months. Going to close but feel free to reopen. |
@monishdeb this might be a good week to work on this and resubmit. |
@colemanw 's option 2 seems like it is still a viable approach. One benefit of select2 being minimally maintained is that there are relatively few changes we would need to worry about happening on something we depend on. |
Overview
Upgrades the Select2 library used for rendering autocompletes, searchable selects, tagging inputs, etc.
Before
Select2 v3.5
After
Select2 v4.0.13
Technical Details
The 4.0.x series contains a compatibility layer which will help during this transition. That's why this PR doesn't take us all the way to the latest 4.1.x.