Skip to content

Commit

Permalink
Merge pull request #11 from herbdool/install
Browse files Browse the repository at this point in the history
Issue #10 bring .install up to Backdrop standards.
  • Loading branch information
quicksketch committed Apr 14, 2016
2 parents c7df2bc + 47a0b53 commit fc47fbb
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions civicrm.install
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
* $Id$
*
*/
function civicrm_install() {}
function civicrm_install() {
db_query("UPDATE {system} SET weight = 100 WHERE name = 'civicrm'");
}

/**
* Implementation of hook_uninstall( )
Expand All @@ -55,16 +57,16 @@ function civicrm_requirements($phase) {
global $base_url;
$civicrm_path = backdrop_get_path('module', 'civicrm');

//remove the last occurrence of 'drupal' from path
$pos = strrpos($civicrm_path, 'drupal');
//remove the last occurrence of 'backdrop' from path
$pos = strrpos($civicrm_path, 'backdrop');

if ($pos !== false) {
$civicrm_path = substr_replace($civicrm_path, '', $pos, strlen($civicrm_path));
}

$url = $base_url . '/' . $civicrm_path . 'install/index.php';

$settings = glob('sites/*/civicrm.settings.php');
$settings = glob('civicrm.settings.php');
$problems = array();
if (empty($settings) && $phase == 'install') {
$problems[] = array(
Expand All @@ -80,18 +82,8 @@ function civicrm_requirements($phase) {
}

/**
* Update CiviCRM module weight
*/
function civicrm_update_7400(&$sandbox) {
db_query("UPDATE {system} SET weight = 100 WHERE name = 'civicrm'");
}

/**
* Trigger cache clear to pick up TZ handling change from CRM-6877.
* Implements hook_update_last_removed().
*/
function civicrm_update_7401($sandbox) {
// This is an empty hook_update_N() so that caches will be
// cleared when update_finished() is called.
return t('TZ changes in CiviCRM Views picked up.');
function civicrm_update_last_removed() {
return 7401;
}

0 comments on commit fc47fbb

Please sign in to comment.