Skip to content

Commit

Permalink
Merge pull request #36 from herbdool/d1
Browse files Browse the repository at this point in the history
Merge in civicrm/drupal from Dec 15, 2015 to June 21, 2017
  • Loading branch information
colemanw authored Jul 9, 2017
2 parents b44d21c + 54d5315 commit ceda319
Show file tree
Hide file tree
Showing 69 changed files with 1,999 additions and 765 deletions.
7 changes: 7 additions & 0 deletions TESTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This repository contains the CiviCRM-Backdrop integration module. It does NOT
contain tests for core functionality. (For tests of core functionality, see
https://github.com/civicrm/civicrm-core .)

At time of writing, these tests execute within the context of the default
Backdrop database. Consequently, you must be quite careful to write tests
which don't leave a mess in the database.
23 changes: 10 additions & 13 deletions civicrm.config.php.backdrop
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@
* return a default value '$confdir/default'.
*
* Example for a fictitious site installed at
* http://www.drupal.org/mysite/test/ the 'settings.php' is
* http://www.backdrop.org/mysite/test/ the 'settings.php' is
* searched in the following directories:
*
* 1. $confdir/www.drupal.org.mysite.test
* 2. $confdir/drupal.org.mysite.test
* 1. $confdir/www.backdrop.org.mysite.test
* 2. $confdir/backdrop.org.mysite.test
* 3. $confdir/org.mysite.test
*
* 4. $confdir/www.drupal.org.mysite
* 5. $confdir/drupal.org.mysite
* 4. $confdir/www.backdrop.org.mysite
* 5. $confdir/backdrop.org.mysite
* 6. $confdir/org.mysite
*
* 7. $confdir/www.drupal.org
* 8. $confdir/drupal.org
* 7. $confdir/www.backdrop.org
* 8. $confdir/backdrop.org
* 9. $confdir/org
*
* 10. $confdir/default
Expand All @@ -43,7 +43,7 @@ function civicrm_conf_init() {
}

/**
* We are within the civicrm module, the drupal root is 2 links
* We are within the civicrm module, the backdrop root is 2 links
* above us, so use that
*/
$currentDir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;
Expand All @@ -64,9 +64,6 @@ function civicrm_conf_init() {
// check to see if this is under sites/all/modules
} else if ( strpos( $currentDir, $moduleDir ) !== false ) {
$confdir = $currentDir . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..';
} else if ( strpos( $currentDir, 'plugins' . DIRECTORY_SEPARATOR . 'civicrm' . DIRECTORY_SEPARATOR . 'civicrm' ) !== false ) {
//if its wordpress
$confdir = $currentDir . DIRECTORY_SEPARATOR . '..';
} else {
$confdir = $currentDir . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR;
}
Expand All @@ -81,7 +78,7 @@ function civicrm_conf_init() {
exit( );
}

// since drupal 7, alias could be defined in sites/sites.php
// alias could be defined in sites/sites.php
if ( file_exists( $confdir . "/sites.php" ) ) {
include $confdir . "/sites.php";
} else {
Expand Down Expand Up @@ -115,7 +112,7 @@ function civicrm_conf_init() {

$settingsFile = civicrm_conf_init( ) . '/civicrm.settings.php';
define('CIVICRM_SETTINGS_PATH', $settingsFile);
$error = @include_once( $settingsFile );
$error = include_once( $settingsFile );
if ( $error == false ) {
echo "Could not load the settings file at: {$settingsFile}\n";
exit( );
Expand Down
2 changes: 1 addition & 1 deletion civicrm.info
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = CiviCRM
description = Constituent relationship management system. Allows sites to manage contacts, relationships and groups, and track contact activities, contributions, memberships and events. See the <a href="https://civicrm.org/">CiviCRM website</a> for more information.
version = 4.7
version = 1.x-4.7
package = CiviCRM
backdrop = 1.x
project = civicrm
Expand Down
4 changes: 2 additions & 2 deletions civicrm.install
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2015 |
| Copyright CiviCRM LLC (c) 2004-2017 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
Expand All @@ -28,7 +28,7 @@
/**
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
* @copyright CiviCRM LLC (c) 2004-2017
* $Id$
*
*/
Expand Down
30 changes: 12 additions & 18 deletions civicrm.module
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* Backdrop module file.
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2016
* @copyright CiviCRM LLC (c) 2004-2017
*/
require_once 'civicrm_user.inc';

Expand Down Expand Up @@ -240,7 +240,6 @@ function civicrm_initialize() {
if (!defined('CIVICRM_SETTINGS_PATH')) {
define('CIVICRM_SETTINGS_PATH', $settingsFile);
}
$error = include_once ($settingsFile);

// get ready for problems
$docLinkInstall = "https://wiki.civicrm.org/confluence/display/CRMDOC/Installing+CiviCRM+for+Backdrop+CMS";
Expand All @@ -255,7 +254,7 @@ function civicrm_initialize() {
)
);

if ($error == FALSE) {
if (!include_once($settingsFile)) {
$failure = TRUE;
backdrop_set_message("<strong><p class='error'>" .
t("Oops! - The CiviCRM settings file (civicrm.settings.php) was not found in the expected location ") .
Expand All @@ -266,8 +265,7 @@ function civicrm_initialize() {
}

// this does pretty much all of the civicrm initialization
$error = include_once ('CRM/Core/Config.php');
if ($error == FALSE) {
if (!include_once('CRM/Core/Config.php')) {
$failure = TRUE;
backdrop_set_message("<strong><p class='error'>" .
t("Oops! - The path for including CiviCRM code files is not set properly. Most likely there is an error in the <em>civicrm_root</em> setting in your CiviCRM settings file (!1).",
Expand Down Expand Up @@ -396,6 +394,7 @@ function _civicrm_registerClassLoader() {
require_once $home . $path;
CRM_Core_ClassLoader::singleton()->register();
}

/**
* Function to get the contact type.
*
Expand Down Expand Up @@ -458,19 +457,14 @@ function civicrm_invoke() {
// synchronize the backdrop uid with the contacts db
global $user;

/*
* FIXME: hack to bypass synchronize if running upgrade to avoid
* any serious non-recoverable error which might hinder the
* upgrade process.
*/

if (!isset($args[1]) ||
$args[1] != 'upgrade'
) {

CRM_Core_BAO_UFMatch::synchronize($user, FALSE, 'Backdrop',
civicrm_get_ctype('Individual')
);
/**
* Bypass synchronize if running upgrade to avoid any serious
* non-recoverable error which might hinder the upgrade process.
*
* @FIXME
*/
if (!isset($args[1]) || $args[1] != 'upgrade') {
CRM_Core_BAO_UFMatch::synchronize($user, FALSE, 'Backdrop', civicrm_get_ctype('Individual'));
}

// Fix the path for the url alias module.
Expand Down
Loading

0 comments on commit ceda319

Please sign in to comment.