4

Can I override core behavior of CRM/SMS/Providers.php by creating the file with the changes in my civicrm_custom_php directory?

1

2 Answers 2

4

The answer is "yes" but...

Overriding an entire file means upgrades will become difficult, as you'll have to manually diff the contents of that file with the one in the new version, and reapply your changes.

If possible, try accomplishing your goal using a hook.

3
  • 1
    I'm only changing one line in the file and it's just changing the activity status from Completed to Needs Response. Otherwise the file is identical. I don't understand hooks, tried figuring them out but never could wrap my head around them.
    – frTommy
    May 2, 2015 at 20:12
  • Documentation for implementing a hook is here. I suggest you try hook_civicrm_postProcess for simple alterations to a submitted form.
    – Coleman
    May 2, 2015 at 20:28
  • Is there also a link to the documentation for overriding PHP files using the custom directory? We use this approach but I couldn't find any links to documentation explaining it in more detail (what can be overridden etc.)
    – John
    Aug 11, 2015 at 15:28
1

The answer is yes, you can do that. I tested it and it worked.

Your Answer

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

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