}
$this->_duplicateButtonName = $this->getButtonName('upload', 'duplicate');
- $gids = explode(',', CRM_Utils_Request::retrieve('gid', 'String', CRM_Core_DAO::$_nullObject, FALSE, 0));
+ $gids = explode(',', (CRM_Utils_Request::retrieve('gid', 'String', CRM_Core_DAO::$_nullObject, FALSE, 0) ?? ''));
if ((count($gids) > 1) && !$this->_profileIds && empty($this->_profileIds)) {
if (!empty($gids)) {
* Build the form object.
*
*/
- public function buildQuickForm() {
+ public function buildQuickForm(): void {
$this->add('hidden', 'gid', $this->_gid);
+ $this->assign('deleteRecord', $this->isDeleteMode());
switch ($this->_mode) {
case self::MODE_CREATE:
return;
}
- if (($this->_multiRecord & CRM_Core_Action::DELETE)) {
+ if ($this->isDeleteMode()) {
if (!$this->_recordExists) {
CRM_Core_Session::setStatus(ts('The record %1 doesnot exists', [1 => $this->_recordId]), ts('Record doesnot exists'), 'alert');
}
- else {
- $this->assign('deleteRecord', TRUE);
- }
return;
}
//lets have single status message,
$this->assign('statusMessage', $statusMessage);
if ($return) {
- return FALSE;
+ return;
}
$this->assign('id', $this->_id);
continue;
}
- list($prefixName, $index) = CRM_Utils_System::explode('-', $name, 2);
+ [$prefixName, $index] = CRM_Utils_System::explode('-', $name, 2);
CRM_Core_BAO_UFGroup::buildProfile($this, $field, $this->_mode);
}
foreach ($fields as $key => $value) {
- list($fieldName, $locTypeId, $phoneTypeId) = CRM_Utils_System::explode('-', $key, 3);
+ [$fieldName, $locTypeId, $phoneTypeId] = CRM_Utils_System::explode('-', $key, 3);
if ($fieldName == 'state_province' && !empty($fields["country-{$locTypeId}"])) {
// Validate Country - State list
$countryId = $fields["country-{$locTypeId}"];
$params['customRecordValues'][$this->_recordId] = array_keys($this->_multiRecordFields);
}
+ // sudoman hack: re-insert filtered group memberships
+ $params = CRM_Contact_Form_Edit_TagsAndGroups::reInsertFilteredGroupMemberships([$this->_gid], $this->_id, TRUE, $params);
+
$this->_id = CRM_Contact_BAO_Contact::createProfileContact(
$params,
$profileFields,
return $fileName ? $fileName : parent::overrideExtraTemplateFileName();
}
+ /**
+ * @return int|string
+ */
+ private function isDeleteMode() {
+ return ($this->_multiRecord & CRM_Core_Action::DELETE);
+ }
+
}