I am working with CiviCRM 5.59.3, and a drupal module that integrates with CiviCase. How can I check if the CiviCRM component is enabled and enable it if it is disabled? I need to do this with php.

1 Answer 1


Calling CRM_Core_BAO_ConfigSetting::enableComponent("CiviCase"); will enable it if not enabled already.

  • Hi @Binary Alchemist, the way stackexchange displays review+edit comments is bizarre. I saw your suggested edit, and accepted part of it but not the addition of the extra if check because the function won't do anything if it's already enabled.
    – Demerit
    Mar 28, 2023 at 2:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.