1

How do one properly replace default 3-rd party packages without loosing changes after updates?

Namely, in need of Datatable CVS File Export, we've grabbed a custom DataTables built with all bells&whistles included from Download Builder page https://datatables.net/download/ and have just replaced stuff in \civicrm\packages\jquery\plugins\DataTables\media\js\

However, changes will be obviously lost after civicrm core update. Is there any recommended technique to handle such things?

Thanks!

0

OK, answering my own question again. So, there are essentially 2 ways to achieve this:

  1. Override \civicrm\CRM\Core\Resources.php (copy it to your custom php directory first, in order to keep control on changes). It contains (quote) List of core resources we add to every CiviCRM page.

  2. Use hook_civicrm_coreResourceList(&$list, $region) {}

(!! Attention: methods of adding 3rd-party resources, described at that page doesn't always work; we've ended up using drupal_add_js. Datatable initialization script has to be wrapped into drupal.behaviors than).

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.