Skip to content

Commit 33e144f

Browse files
committed
Upgrade to CiviCRM 5.31.0
Includes new features, bug fixes, and changes to the database schema. Requires database updates. Notes: * https://github.com/civicrm/civicrm-core/blob/master/release-notes/5.30.0.md * https://github.com/civicrm/civicrm-core/blob/master/release-notes/5.30.1.md * https://github.com/civicrm/civicrm-core/blob/master/release-notes/5.31.0.md Backup your site using Pantheon's backup tool first. Then either go to http://<your_drupal_home>/civicrm/upgrade?reset=1 or use terminus drush site.env civicrm-upgrade-db. Fully test on a dev environment before upgrading on live. If you have questions contact https://civicrmstarterkit.org/contact. We provide some basic general support for the public. If you require help with your specific website there will likely be a cost.
1 parent 347ec7f commit 33e144f

File tree

1,385 files changed

+114672
-14895
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,385 files changed

+114672
-14895
lines changed

profiles/civicrm_starterkit/civicrm_starterkit.make

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ core = 7.51
88
api = 2
99

1010
; Drupal Core
11-
projects[drupal][version] = "7.61"
11+
projects[drupal][version] = "7.73"
1212

1313
; ====== CIVICRM RELATED =========
1414

1515
libraries[civicrm][download][type] = get
16-
libraries[civicrm][download][url] = "https://download.civicrm.org/civicrm-5.29.1-drupal.tar.gz"
16+
libraries[civicrm][download][url] = "https://download.civicrm.org/civicrm-5.31.0-drupal.tar.gz"
1717
libraries[civicrm][destination] = modules
1818
libraries[civicrm][directory_name] = civicrm
1919

profiles/civicrm_starterkit/modules/civicrm/CRM/ACL/BAO/ACL.php

+14-21
Original file line numberDiff line numberDiff line change
@@ -204,36 +204,29 @@ protected static function getGroupACLs($contact_id, $aclRoles = FALSE) {
204204
protected static function getGroupACLRoles($contact_id) {
205205
$contact_id = CRM_Utils_Type::escape($contact_id, 'Integer');
206206

207-
$rule = new CRM_ACL_BAO_ACL();
208-
209-
$aclRole = 'civicrm_acl_role';
210-
211-
$aclER = CRM_ACL_DAO_EntityRole::getTableName();
212-
$c2g = CRM_Contact_BAO_GroupContact::getTableName();
213-
214207
$query = " SELECT acl.*
215208
FROM civicrm_acl acl
216209
INNER JOIN civicrm_option_group og
217210
ON og.name = 'acl_role'
218211
INNER JOIN civicrm_option_value ov
219-
ON acl.entity_table = '$aclRole'
212+
ON acl.entity_table = 'civicrm_acl_role'
220213
AND ov.option_group_id = og.id
221214
AND acl.entity_id = ov.value
222215
AND ov.is_active = 1
223-
INNER JOIN $aclER
224-
ON $aclER.acl_role_id = acl.entity_id
225-
AND $aclER.is_active = 1
226-
INNER JOIN $c2g
227-
ON $aclER.entity_id = $c2g.group_id
228-
AND $aclER.entity_table = 'civicrm_group'
229-
WHERE acl.entity_table = '$aclRole'
216+
INNER JOIN civicrm_acl_entity_role acl_entity_role
217+
ON acl_entity_role.acl_role_id = acl.entity_id
218+
AND acl_entity_role.is_active = 1
219+
INNER JOIN civicrm_group_contact group_contact
220+
ON acl_entity_role.entity_id = group_contact.group_id
221+
AND acl_entity_role.entity_table = 'civicrm_group'
222+
WHERE acl.entity_table = 'civicrm_acl_role'
230223
AND acl.is_active = 1
231-
AND $c2g.contact_id = $contact_id
232-
AND $c2g.status = 'Added'";
224+
AND group_contact.contact_id = $contact_id
225+
AND group_contact.status = 'Added'";
233226

234227
$results = [];
235228

236-
$rule->query($query);
229+
$rule = CRM_Core_DAO::executeQuery($query);
237230

238231
while ($rule->fetch()) {
239232
$results[$rule->id] = $rule->toArray();
@@ -254,7 +247,7 @@ protected static function getGroupACLRoles($contact_id) {
254247
AND acl.entity_table = 'civicrm_acl_role'
255248
";
256249

257-
$rule->query($query);
250+
$rule = CRM_Core_DAO::executeQuery($query);
258251
while ($rule->fetch()) {
259252
$results[$rule->id] = $rule->toArray();
260253
}
@@ -484,10 +477,10 @@ public static function group(
484477
$aclKeys = array_keys($acls);
485478
$aclKeys = implode(',', $aclKeys);
486479

487-
$cacheKey = CRM_Utils_Cache::cleanKey("$tableName-$aclKeys");
480+
$cacheKey = CRM_Utils_Cache::cleanKey("$type-$tableName-$aclKeys");
488481
$cache = CRM_Utils_Cache::singleton();
489482
$ids = $cache->get($cacheKey);
490-
if (!$ids) {
483+
if (!is_array($ids)) {
491484
$ids = [];
492485
$query = "
493486
SELECT a.operation, a.object_id

profiles/civicrm_starterkit/modules/civicrm/CRM/ACL/DAO/ACL.php

+8-3
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
*
77
* Generated from xml/schema/CRM/ACL/ACL.xml
88
* DO NOT EDIT. Generated by CRM_Core_CodeGen
9-
* (GenCodeChecksum:d91adfb9ffb0a514d42f6828f1b95033)
9+
* (GenCodeChecksum:54e8c75c28c9dd74192f60bbcf1605f6)
1010
*/
1111

1212
/**
1313
* Database access object for the ACL entity.
1414
*/
1515
class CRM_ACL_DAO_ACL extends CRM_Core_DAO {
16+
const EXT = 'civicrm';
17+
const TABLE_ADDED = '1.6';
1618

1719
/**
1820
* Static instance to hold the table name.
@@ -115,9 +117,12 @@ public function __construct() {
115117

116118
/**
117119
* Returns localized title of this entity.
120+
*
121+
* @param bool $plural
122+
* Whether to return the plural version of the title.
118123
*/
119-
public static function getEntityTitle() {
120-
return ts('ACLs');
124+
public static function getEntityTitle($plural = FALSE) {
125+
return $plural ? ts('ACLs') : ts('ACL');
121126
}
122127

123128
/**

profiles/civicrm_starterkit/modules/civicrm/CRM/ACL/DAO/ACLCache.php

+16-5
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
*
77
* Generated from xml/schema/CRM/ACL/ACLCache.xml
88
* DO NOT EDIT. Generated by CRM_Core_CodeGen
9-
* (GenCodeChecksum:0427e4f02009f7a66cf34ae18ef397aa)
9+
* (GenCodeChecksum:7faa5879056a56b463304bd81829afda)
1010
*/
1111

1212
/**
1313
* Database access object for the ACLCache entity.
1414
*/
1515
class CRM_ACL_DAO_ACLCache extends CRM_Core_DAO {
16+
const EXT = 'civicrm';
17+
const TABLE_ADDED = '1.6';
1618

1719
/**
1820
* Static instance to hold the table name.
@@ -66,9 +68,12 @@ public function __construct() {
6668

6769
/**
6870
* Returns localized title of this entity.
71+
*
72+
* @param bool $plural
73+
* Whether to return the plural version of the title.
6974
*/
70-
public static function getEntityTitle() {
71-
return ts('ACLCaches');
75+
public static function getEntityTitle($plural = FALSE) {
76+
return $plural ? ts('ACLCaches') : ts('ACLCache');
7277
}
7378

7479
/**
@@ -80,7 +85,6 @@ public static function getEntityTitle() {
8085
public static function getReferenceColumns() {
8186
if (!isset(Civi::$statics[__CLASS__]['links'])) {
8287
Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
83-
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'contact_id', 'civicrm_contact', 'id');
8488
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'acl_id', 'civicrm_acl', 'id');
8589
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
8690
}
@@ -118,7 +122,6 @@ public static function &fields() {
118122
'entity' => 'ACLCache',
119123
'bao' => 'CRM_ACL_DAO_ACLCache',
120124
'localizable' => 0,
121-
'FKClassName' => 'CRM_Contact_DAO_Contact',
122125
'html' => [
123126
'type' => 'EntityRef',
124127
],
@@ -226,6 +229,14 @@ public static function &export($prefix = FALSE) {
226229
*/
227230
public static function indices($localize = TRUE) {
228231
$indices = [
232+
'index_contact_id' => [
233+
'name' => 'index_contact_id',
234+
'field' => [
235+
0 => 'contact_id',
236+
],
237+
'localizable' => FALSE,
238+
'sig' => 'civicrm_acl_cache::0::contact_id',
239+
],
229240
'index_acl_id' => [
230241
'name' => 'index_acl_id',
231242
'field' => [

profiles/civicrm_starterkit/modules/civicrm/CRM/ACL/DAO/EntityRole.php

+8-3
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
*
77
* Generated from xml/schema/CRM/ACL/EntityRole.xml
88
* DO NOT EDIT. Generated by CRM_Core_CodeGen
9-
* (GenCodeChecksum:2e8133b4c385feaa934b2d14ea40f971)
9+
* (GenCodeChecksum:c1087517beb5b266d4a1a0a1a342ced0)
1010
*/
1111

1212
/**
1313
* Database access object for the EntityRole entity.
1414
*/
1515
class CRM_ACL_DAO_EntityRole extends CRM_Core_DAO {
16+
const EXT = 'civicrm';
17+
const TABLE_ADDED = '1.6';
1618

1719
/**
1820
* Static instance to hold the table name.
@@ -73,9 +75,12 @@ public function __construct() {
7375

7476
/**
7577
* Returns localized title of this entity.
78+
*
79+
* @param bool $plural
80+
* Whether to return the plural version of the title.
7681
*/
77-
public static function getEntityTitle() {
78-
return ts('Entity Roles');
82+
public static function getEntityTitle($plural = FALSE) {
83+
return $plural ? ts('Entity Roles') : ts('Entity Role');
7984
}
8085

8186
/**

profiles/civicrm_starterkit/modules/civicrm/CRM/ACL/Form/ACL.php

+7-6
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,12 @@ public function buildQuickForm() {
9696

9797
$this->add('text', 'name', ts('Description'), CRM_Core_DAO::getAttribute('CRM_ACL_DAO_ACL', 'name'), TRUE);
9898

99-
$operations = ['' => ts('- select -')] + CRM_ACL_BAO_ACL::operation();
10099
$this->add('select',
101100
'operation',
102101
ts('Operation'),
103-
$operations, TRUE
102+
CRM_ACL_BAO_ACL::operation(),
103+
TRUE,
104+
['placeholder' => TRUE]
104105
);
105106

106107
$objTypes = [
@@ -129,22 +130,22 @@ public function buildQuickForm() {
129130
$this->add('select', 'entity_id', $label, $role, TRUE);
130131

131132
$group = [
132-
'-1' => ts('- select -'),
133+
'-1' => ts('- select group -'),
133134
'0' => ts('All Groups'),
134135
] + CRM_Core_PseudoConstant::group();
135136

136137
$customGroup = [
137-
'-1' => ts('- select -'),
138+
'-1' => ts('- select set of custom fields -'),
138139
'0' => ts('All Custom Groups'),
139140
] + CRM_Core_PseudoConstant::get('CRM_Core_DAO_CustomField', 'custom_group_id');
140141

141142
$ufGroup = [
142-
'-1' => ts('- select -'),
143+
'-1' => ts('- select profile -'),
143144
'0' => ts('All Profiles'),
144145
] + CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFField', 'uf_group_id');
145146

146147
$event = [
147-
'-1' => ts('- select -'),
148+
'-1' => ts('- select event -'),
148149
'0' => ts('All Events'),
149150
] + CRM_Event_PseudoConstant::event(NULL, FALSE, "( is_template IS NULL OR is_template != 1 )");
150151

profiles/civicrm_starterkit/modules/civicrm/CRM/ACL/Form/EntityRole.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ public function buildQuickForm() {
2626
return;
2727
}
2828

29-
$aclRoles = ['' => ts('- select -')] + CRM_Core_OptionGroup::values('acl_role');
3029
$this->add('select', 'acl_role_id', ts('ACL Role'),
31-
$aclRoles, TRUE
30+
CRM_Core_OptionGroup::values('acl_role'), TRUE, ['placeholder' => TRUE]
3231
);
3332

3433
$label = ts('Assigned to');

profiles/civicrm_starterkit/modules/civicrm/CRM/Activity/ActionMapping.php

+8
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,12 @@ public function createQuery($schedule, $phase, $defaultParams) {
118118
return $query;
119119
}
120120

121+
/**
122+
* Determine whether a schedule based on this mapping should
123+
* send to additional contacts.
124+
*/
125+
public function sendToAdditional($entityId): bool {
126+
return TRUE;
127+
}
128+
121129
}

0 commit comments

Comments
 (0)