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

Make financialacls require civi-contribute #28318

Merged
merged 2 commits into from Nov 26, 2023

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Make financialacls require civi-contribute

Before

I think disabling civi-contribute & leaving financialacls enabled would be risky

After

there is a required

Technical Details

This actually fails on tests & I don't know how to fix - but I put up the PR to highlight it

CRM_Event_Form_Registration_ConfirmTest::testRegistrationWithoutCiviContributeEnabled
Exception: CRM_Extension_Exception_DependencyException: "Cannot disable extension due to dependencies. Consider disabling all these: civi_contribute,financialacls"
#0 /home/homer/buildkit/build/build-4/web/sites/all/modules/civicrm/CRM/Core/Component.php(451): CRM_Extension_Manager->disable((Array:1))
#1 internal function: CRM_Core_Component::onToggleComponents((Array:6), (Array:5), (Array:16), 1)
#2 /home/homer/buildkit/build/build-4/web/sites/all/modules/civicrm/Civi/Core/SettingsBag.php(440): call_user_func((Array:2), (Array:6), (Array:5), (Array:16), 1)
#3 /home/homer/buildkit/build/build-4/web/sites/all/modules/civicrm/Civi/Core/SettingsBag.php(250): Civi\Core\SettingsBag->setDb("enable_components", (Array:5))
#4 /home/homer/buildkit/build/build-4/web/sites/all/modules/civicrm/CRM/Core/BAO/ConfigSetting.php(366): Civi\Core\SettingsBag->set("enable_components", (Array:5))
#5 /home/homer/buildkit/build/build-4/web/sites/all/modules/civicrm/CRM/Core/BAO/ConfigSetting.php(355): CRM_Core_BAO_ConfigSetting::setEnabledComponents((Array:5))

Comments

Copy link

civibot bot commented Nov 26, 2023

🤖 Thank you for contributing to CiviCRM! ❤️ We will need to test and review this PR. 👷

Introduction for new contributors...
  • If this is your first PR, an admin will greenlight automated testing with the command ok to test or add to whitelist.
  • A series of tests will automatically run. You can see the results at the bottom of this page (if there are any problems, it will include a link to see what went wrong).
  • A demo site will be built where anyone can try out a version of CiviCRM that includes your changes.
  • If this process needs to be repeated, an admin will issue the command test this please to rerun tests and build a new demo site.
  • Before this PR can be merged, it needs to be reviewed. Please keep in mind that reviewers are volunteers, and their response time can vary from a few hours to a few weeks depending on their availability and their knowledge of this particular part of CiviCRM.
  • A great way to speed up this process is to "trade reviews" with someone - find an open PR that you feel able to review, and leave a comment like "I'm reviewing this now, could you please review mine?" (include a link to yours). You don't have to wait for a response to get started (and you don't have to stop at one!) the more you review, the faster this process goes for everyone 😄
  • To ensure that you are credited properly in the final release notes, please add yourself to contributor-key.yml
  • For more information about contributing, see CONTRIBUTING.md.
Quick links for reviewers...

➡️ Online demo of this PR 🔗

@civibot civibot bot added the master label Nov 26, 2023
@colemanw
Copy link
Member

@eileenmcnaughton I've pushed a fix

@eileenmcnaughton
Copy link
Contributor Author

eileenmcnaughton commented Nov 26, 2023

thanks @colemanw - your changes look good (& we know they are tested as they were to fix a test) so I'm gonna merge as a collaboration

@eileenmcnaughton eileenmcnaughton merged commit 74b4144 into civicrm:master Nov 26, 2023
3 checks passed
@eileenmcnaughton eileenmcnaughton deleted the requires branch November 26, 2023 19:02
@colemanw
Copy link
Member

colemanw commented Feb 8, 2024

I think this may have caught some people out @eileenmcnaughton
since this is a core extension it was force-installed, even for people who do not have CiviContribute enabled, then they get an error about the missing dependency.

https://civicrm.stackexchange.com/questions/46426/financials-acls-status-error

@eileenmcnaughton
Copy link
Contributor Author

yeah - we could probably uninstall the extension if the setting is not enabled

@colemanw
Copy link
Member

colemanw commented Feb 8, 2024

@eileenmcnaughton the combination of the extension having a dependency and the extension being mgmt:hidden is the double-whammy - users are presented with an error but they are not allowed to fix it. I think possible solutions would be:

  1. Complete Fix:
    a. Conditionally install hidden core extensions based on their dependencies.
    b. Add code that keeps hidden core extensions in-sync: enable it when its dependency is enabled, disable it when its dependency is disabled.
    c. Add an upgrade script to disable hidden core extensions with unmet dependencies.
  2. Quick Fix: Revert this PR.
  3. Cheeky Fix: Move the financialacls code into the civi_contribute extension.

@eileenmcnaughton
Copy link
Contributor Author

@colemanw I think we can unhide it if it's still hidden & auto-unisntall it on anyone who has not specifically set the setting to make it do stuff (& just remove that setting & make it do stuff when it is enabled, rather than when it is enabled AND the setting is set)

@colemanw
Copy link
Member

colemanw commented Feb 8, 2024

@eileenmcnaughton ok the readme says it's not safe to disable the extension while it's in development and parts are moving, so that stage is done?

@eileenmcnaughton
Copy link
Contributor Author

well I think it's safe now - I thought we had stopped enabling on new installs.

There is some interaction I'd like gone but I think it's more like functions that should be in the extension are in core rather than core calling the extension direction #28960 is open & I need to take another crack at #28967

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