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

Fix onCrmUiSelect to use current scope and apply to the digest cycle #20879

Merged
merged 1 commit into from
Jul 16, 2021

Conversation

colemanw
Copy link
Member

Overview

Fixes the new onCrmUiSelect directive introduced in #20789

Before

Operates outside of current scope and outside the digest cycle.

After

Works as expected.

@civibot
Copy link

civibot bot commented Jul 16, 2021

(Standard links)

Evaluates expression in current scope rather than parent scope,
and uses $scope.$apply.
@totten
Copy link
Member

totten commented Jul 16, 2021

I tested this (r-run) with the draft msgtplui extension and confirmed that it still works there. The main "New Mailing" screen doesn't yet use this, IIRC.

The patch makes sense on general grounds -- e.g. it does read like it was running outside the regular digest cycle.

I'm not entirely certain why this didn't manifest as quirkiness in previous usage. (FWIW, this code was borrowed from ang/crmMailing/Token.js.) Maybe some happenstance in the particular screen/UI/use-case (e.g. something else that triggers digest around the needful time).

Test failure in CRM_Core_DAOTest.testSqlModePresent looks unrelated. Merging.

@totten totten merged commit 396b4a9 into civicrm:master Jul 16, 2021
@colemanw colemanw deleted the fixOnCrmUiSelect branch July 16, 2021 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants