2

drush and cv have both have commands to install extensions. But know I want to create a script that sets the CiviCRM components. Is it possible to do this?

2

Thanks to passing JSON objects to drush cvapi I found a solution:

echo '{"enable_components" :["CiviContribute","CiviMember","CiviMail","CiviReport","CiviEvent"] }' | drush cvapi Setting.create --in=json
2

For those that use cv is also possible to use:

echo '{"enable_components" :["CiviContribute","CiviMember","CiviMail","CiviReport","CiviEvent"] }' | cv api Setting.create --in=json
1
  • For API4, the syntax is: echo '{"values":{"enable_components":["CiviContribute","CiviMember","CiviReport"]}}' | cv api4 Setting.set --in=json or cv api4 Setting.set '{"values":{"enable_components":["CiviContribute","CiviMember","CiviReport","CiviPledge"]}}'.
    – Martin_W
    Mar 21 at 23:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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