Answers.Body: <p>OK, answering my own question again. So, there are essentially 2 ways to achieve this:</p>
  
  <ol>
  <li><p>Override  \civicrm\CRM\Core\Resources.php (copy it to your custom php directory first, in order to keep control on changes). It contains (quote) <em>List of core resources we add to every CiviCRM page.</em></p></li>
  <li><p>Use <a href="https://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_coreResourceList" rel="nofollow">hook_civicrm_coreResourceList(&amp;$list, $region) {}</a> </p></li>
  </ol>
  
  <p><em>(!! 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).</em> </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-19T18:25:12.267Z
Answers.LastActivityDate: 2016-02-19T18:40:37.043Z
Answers.LastEditDate: 2016-02-19T18:40:37.043Z
Answers.UserDisplayName: yurg
Body: <p>How do one properly replace default 3-rd party packages without loosing changes after updates? </p>
  
  <p>Namely, in need of Datatable CVS File Export, we've grabbed a custom DataTables built with all bells&amp;whistles included from Download Builder page <a href="https://datatables.net/download/" rel="nofollow">https://datatables.net/download/</a> and have just replaced stuff in    \civicrm\packages\jquery\plugins\DataTables\media\js\   </p>
  
  <p>However, changes will be obviously lost after civicrm core update. Is there any recommended technique to handle such things? </p>
  
  <p>Thanks!</p>
  
Tags: <api><upgrade><developer><javascript>
Title: Replace default Datatables script to most recent [custom buit] one
ThreadText: # Replace default Datatables script to most recent [custom buit] one
  
  (Asked by: username_0 on 2016-02-18)
  
  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!
  
  **Tags:** api, upgrade, developer, javascript
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2016-02-19. Score: 0 | Accepted answer
  
  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) {}](https://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_coreResourceList)
  
  *(!! 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).*
  
  
  ---
  
  