Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.82 #31877

Merged
merged 2 commits into from
Jan 24, 2025
Merged

5.82 #31877

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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