Skip to content

Commit

Permalink
Merge pull request #29226 from eileenmcnaughton/tags_g
Browse files Browse the repository at this point in the history
Php 8.x notice fix on tags & groups fields
  • Loading branch information
colemanw authored Feb 6, 2024
2 parents 12ba587 + 69c0270 commit 7a38c88
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CRM/Contact/Form/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ public function buildQuickForm() {
}

// build tags and groups
CRM_Contact_Form_Edit_TagsAndGroups::buildQuickForm($this, 0, CRM_Contact_Form_Edit_TagsAndGroups::ALL,
CRM_Contact_Form_Edit_TagsAndGroups::buildQuickForm($this, $this->getContactID(), CRM_Contact_Form_Edit_TagsAndGroups::ALL,
FALSE, NULL, 'Group(s)', 'Tag(s)', NULL, 'select');

// build location blocks.
Expand Down
5 changes: 4 additions & 1 deletion CRM/Contact/Form/Edit/TagsAndGroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public static function buildQuickForm(
$form->addOptionalQuickFormElement('group');
// NYSS 5670
if (!$contactId && !empty($form->_contactId)) {
CRM_Core_Error::deprecatedWarning('this is thought to be unreachable, should be passed in');
$contactId = $form->_contactId;
}

Expand All @@ -73,8 +74,10 @@ public static function buildQuickForm(
if ($fieldName) {
$fName = $fieldName;
}
// The optional url parameter grid is refers to Group ID.
// If it set the group options on the page are limited to that group
$groupID = is_numeric(CRM_Utils_Request::retrieve('grid', 'Integer', $form)) ? (int) CRM_Utils_Request::retrieve('grid', 'Integer', $form) : NULL;

$groupID = $form->_grid ?? NULL;
if ($groupID && $visibility) {
$ids = [$groupID => $groupID];
}
Expand Down
3 changes: 3 additions & 0 deletions CRM/Profile/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ class CRM_Profile_Form extends CRM_Core_Form {
* The group id that we are passing in url.
*
* @var int
*
* @deprecated
* @internal
*/
public $_grid;

Expand Down

0 comments on commit 7a38c88

Please sign in to comment.