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 deprecated 'settings' in .ang.php files #985

Open
colemanw opened this issue Oct 13, 2023 · 3 comments · May be fixed by #991
Open

Fix deprecated 'settings' in .ang.php files #985

colemanw opened this issue Oct 13, 2023 · 3 comments · May be fixed by #991

Comments

@colemanw
Copy link

colemanw commented Oct 13, 2023

Since 2020, 'settings' are deprecated in favor of 'settingsFactory' and will soon stop being supported altogether.

This is a straightforward fix. For each .ang.php file, simply by move the settings array into a function.

@colemanw
Copy link
Author

colemanw commented Oct 19, 2023

Both of those examples are a little noisy with unrelated changes but the first two files from example 1 is the relevant part and shows how simple this refactor is (it's really just moving an array from one place to another):
image

@agileware-fj
Copy link

@colemanw one of the things the angular module does at the time of building the settings is to load affix.js from the shoreditch theme extension, which isn't an angular module.
I tried to migrate this into the settingsFactory callback, but it seems resources added during this callback are not.
It's also probably something that should be resolved at the time the module is cached.

Do you have any insights into including javascript from another extension into the js key for the angular module declaration?

@colemanw
Copy link
Author

@agileware-fj I believe it is possible to include javascript files outside of the angular directory. This one does it:

https://github.com/civicrm/civicrm-core/blob/da9f6ba54f6f940cec53db9bc7fce4aba8bb6353/ang/angularFileUpload.ang.php#L2-L6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants