Skip to content
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

AngularJS - Remove UI-Utils library #23749

Merged
merged 1 commit into from
Jun 14, 2022
Merged

Conversation

colemanw
Copy link
Member

@colemanw colemanw commented Jun 10, 2022

Overview

Fixes the bug reported in https://lab.civicrm.org/dev/core/-/issues/2688 by removing the problematic Angular library, which turned out to be unneeded.

Before

See bug report: https://lab.civicrm.org/dev/core/-/issues/2688

After

UI-Utils removed, which fixes the bug.

Technical Details

The UI-Utils Library is a large collection of utilities. It was added to CiviCRM during the experimental phase of trying out AngularJS, but never used for much of anything, and never upgraded when new releases came out. We've only used one of it's utils (ui-jq, which is a simple wrapper for jQuery) and for trivial purposes that I've refactored out in this PR.

The library was breaking jQuery widgets (notably Select2) by attempting to insert jqLite shims into jQuery, based on faulty logic to check if window.jQuery is present (which it's not since CiviCRM uses noConflict() mode). This bug was masked in most cases by the presence of the CMS's copy of jQuery. But the bug was manifesting on any page that lacked jQuery, such as front-end WP pages.

Comments

Since it's abandonware and not needed, it seems best to remove the library rather than try to patch it.

@civibot
Copy link

civibot bot commented Jun 10, 2022

(Standard links)

@civibot civibot bot added the master label Jun 10, 2022
colemanw added a commit to colemanw/com.joineryhq.mappins that referenced this pull request Jun 10, 2022
@eileenmcnaughton
Copy link
Contributor

test this please

@seamuslee001
Copy link
Contributor

@colemanw test fail relates

@totten
Copy link
Member

totten commented Jun 10, 2022

Note that testResolveDeps() is just meant to be some arbitrary example modules. So if the arbitrary examples have changed, the test can change.

The [UI-Utils Libary](https://github.com/angular-ui/ui-utils/tree/v0.1.1) was introduced in 2014,
but never used for much of anything. It remains very underutilized, and is the source of a major bug
(see https://lab.civicrm.org/dev/core/-/issues/2688).
Since it's abandonware, it seems best to stop using it rather than try to patch it.

Fixes dev/core#2688
@demeritcowboy demeritcowboy added the merge ready PR will be merged after a few days if there are no objections label Jun 11, 2022
@demeritcowboy
Copy link
Contributor

Have given a brief run but on drupal whereas the lab ticket was about wordpress. If somebody just wants to give a wordpress run I'd say it's mergeable.

@demeritcowboy
Copy link
Contributor

Just noticed tests don't seem to have run on the latest commit. Jenkins test this please.

Untitled2

@kcristiano
Copy link
Member

kcristiano commented Jun 13, 2022

@colemanw I can recreate the error and this PR does fix the dropdowns.

I do get some console errors as an anonymous user:

image

@colemanw
Copy link
Member Author

@kcristiano I'm not seeing those errors when I test it. How about we merge this & then follow-up once we have steps to reproduce those.

@civicrm-builder retest this please

@kcristiano
Copy link
Member

@colemanw I am OK with merging and then following up in testing/RC phase as this targets master

@colemanw colemanw added merge on pass and removed merge ready PR will be merged after a few days if there are no objections labels Jun 14, 2022
@eileenmcnaughton eileenmcnaughton merged commit 8ca61a2 into civicrm:master Jun 14, 2022
@eileenmcnaughton eileenmcnaughton deleted the uiUtils branch June 14, 2022 20:11
seamuslee001 added a commit to seamuslee001/civicrm-core that referenced this pull request Jun 21, 2022
demeritcowboy added a commit that referenced this pull request Jun 21, 2022
[REF] Follow on from #23749 and remove refernece to ui-utils from kar…
agileware-justin pushed a commit to agileware/org.civicoop.action-provider that referenced this pull request Jun 28, 2022
colemanw added a commit to colemanw/civicrm-core that referenced this pull request Aug 9, 2022
Prior to civicrm#23749 this had been passing an object around as a string.
During the refactoring it was treated as an object but still left as a string param.
Now it's passed as an object.
colemanw added a commit to colemanw/civicrm-core that referenced this pull request Aug 9, 2022
Prior to civicrm#23749 this had been passing an object around as a string.
During the refactoring it was treated as an object but still left as a string param.
Now it's passed as an object.
totten pushed a commit to totten/civicrm-core that referenced this pull request Aug 9, 2022
Prior to civicrm#23749 this had been passing an object around as a string.
During the refactoring it was treated as an object but still left as a string param.
Now it's passed as an object.
colemanw added a commit to colemanw/civicrm-core that referenced this pull request Aug 10, 2022
As part of civicrm#23749 select elements using
ui-jq were switched to crm-ui-select, which should have been a drop-in replacement,
but it turns out it broke for widgets using ngOptions. This fixes it.

Fixes dev/core#3797
colemanw added a commit to colemanw/civicrm-core that referenced this pull request Aug 10, 2022
As part of civicrm#23749 select elements using
ui-jq were switched to crm-ui-select, which should have been a drop-in replacement,
but it turns out it broke for widgets using ngOptions. This fixes it.

Fixes dev/core#3797
colemanw added a commit to colemanw/civicrm-core that referenced this pull request Aug 11, 2022
As part of civicrm#23749 select elements using
ui-jq were switched to crm-ui-select, which should have been a drop-in replacement,
but it turns out it broke for widgets using ngOptions. This fixes it.

Fixes dev/core#3797
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants