Skip to content

Commit

Permalink
Merge pull request #31877 from civicrm/5.82
Browse files Browse the repository at this point in the history
5.82
  • Loading branch information
demeritcowboy authored Jan 24, 2025
2 parents b5a4b78 + 17b9e05 commit 40b8cd6
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CRM/Case/XMLProcessor/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ public static function printCaseReport() {

// Retrieve custom values for cases.
$customValues = CRM_Core_BAO_CustomValueTable::getEntityValues($caseID, 'Case');
$groupTree = CRM_Core_BAO_CustomGroup::getAll(['extends' => ['Case']]);
$groupTree = CRM_Core_BAO_CustomGroup::getAll(['extends' => ['Case'], 'is_active' => TRUE]);
$caseCustomFields = [];
foreach ($groupTree as $gid => $group_values) {
foreach ($group_values['fields'] as $id => $field_values) {
Expand Down
2 changes: 1 addition & 1 deletion CRM/Contact/Form/Search/Advanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function buildQuickForm() {
];

//check if there are any custom data searchable fields
$groupDetails = CRM_Core_BAO_CustomGroup::getAll(['extends' => 'Contact']);
$groupDetails = CRM_Core_BAO_CustomGroup::getAll(['extends' => 'Contact', 'is_active' => TRUE]);
// if no searchable fields unset panel
if (empty($groupDetails)) {
unset($paneNames[ts('Custom Fields')]);
Expand Down
2 changes: 1 addition & 1 deletion CRM/Contact/Form/Search/Criteria.php
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ public static function notes(&$form) {
*/
public static function custom(&$form) {
$form->add('hidden', 'hidden_custom', 1);
$groupDetails = CRM_Core_BAO_CustomGroup::getAll(['extends' => 'Contact']);
$groupDetails = CRM_Core_BAO_CustomGroup::getAll(['extends' => 'Contact', 'is_active' => TRUE]);
$form->assign('groupTree', $groupDetails);

foreach ($groupDetails as $key => $group) {
Expand Down
2 changes: 1 addition & 1 deletion CRM/Contribute/BAO/ContributionRecur.php
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ public static function copyCustomValues($recurId, $targetContributionId) {
}

// copy custom data
$groupTree = CRM_Core_BAO_CustomGroup::getAll(['extends' => ['Contribution']]);
$groupTree = CRM_Core_BAO_CustomGroup::getAll(['extends' => ['Contribution'], 'is_active' => TRUE]);
if ($groupTree) {
foreach ($groupTree as $groupID => $group) {
$table[$groupTree[$groupID]['table_name']] = ['entity_id'];
Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/BAO/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class CRM_Core_BAO_Query {
* @param array $extends
*/
public static function addCustomFormFields(&$form, $extends) {
$groupDetails = CRM_Core_BAO_CustomGroup::getAll(['extends' => $extends]);
$groupDetails = CRM_Core_BAO_CustomGroup::getAll(['extends' => $extends, 'is_active' => TRUE]);
if ($groupDetails) {
foreach ($groupDetails as $group) {
if (empty($group['fields'])) {
Expand Down
2 changes: 1 addition & 1 deletion CRM/Event/BAO/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public static function del($id) {
*/
public static function self_hook_civicrm_pre(\Civi\Core\Event\PreEvent $event) {
if ($event->action === 'delete' && $event->id) {
$groupTree = CRM_Core_BAO_CustomGroup::getAll(['extends' => ['Event']]);
$groupTree = CRM_Core_BAO_CustomGroup::getAll(['extends' => ['Event'], 'is_active' => TRUE]);
// @todo is this custom field loop necessary? The cascade delete on the
// db foreign key should do it already.
foreach ($groupTree as $values) {
Expand Down

0 comments on commit 40b8cd6

Please sign in to comment.