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

Fold private setGroupTree function back into caller #26844

Merged
merged 2 commits into from
Jul 16, 2023
Merged
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
27 changes: 5 additions & 22 deletions CRM/Custom/Form/CustomDataByType.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public function preProcess() {

$this->_type = $this->_cdType = CRM_Utils_Request::retrieve('type', 'String', CRM_Core_DAO::$_nullObject, TRUE);
$subType = CRM_Utils_Request::retrieve('subType', 'String');
$this->_subName = CRM_Utils_Request::retrieve('subName', 'String');
$this->_groupCount = CRM_Utils_Request::retrieve('cgcount', 'Positive');
$this->_entityId = CRM_Utils_Request::retrieve('entityID', 'Positive');
$this->_contactID = CRM_Utils_Request::retrieve('cid', 'Positive');
Expand All @@ -48,25 +47,6 @@ public function preProcess() {
if (array_key_exists($this->_type, $contactTypes)) {
$this->assign('contactId', $this->_entityId);
}
$this->setGroupTree($this, $subType, $groupID, $onlySubType);

$this->assign('suppressForm', TRUE);
$this->controller->_generateQFKey = FALSE;
}

/**
* Add the group data as a formatted array to the form.
*
* This was split off from a shared function.
*
* @param self $form
* @param string $subType
* @param int $gid
* @param bool $onlySubType
*
* @throws \CRM_Core_Exception
*/
private function setGroupTree(&$form, $subType, $gid, $onlySubType = NULL) {
$singleRecord = NULL;
if (!empty($form->_groupCount) && !empty($form->_multiRecordDisplay) && $form->_multiRecordDisplay == 'single') {
$singleRecord = $form->_groupCount;
Expand All @@ -81,9 +61,9 @@ private function setGroupTree(&$form, $subType, $gid, $onlySubType = NULL) {
$groupTree = CRM_Core_BAO_CustomGroup::getTree($form->_type,
NULL,
$form->_entityId,
$gid,
$groupID,
$subType,
$form->_subName,
CRM_Utils_Request::retrieve('subName', 'String'),
TRUE,
$onlySubType,
FALSE,
Expand All @@ -106,6 +86,9 @@ private function setGroupTree(&$form, $subType, $gid, $onlySubType = NULL) {
else {
$form->_groupTree = $groupTree;
}

$this->assign('suppressForm', TRUE);
$this->controller->_generateQFKey = FALSE;
}

/**
Expand Down