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

ACLEntityRole BAO tidy fixes #20504

Merged

Conversation

monishdeb
Copy link
Member

Overview

Miscellaneous fixes on

Technical Details

Followup PR of #20474

Comments

ping @eileenmcnaughton @seamuslee001 @colemanw

@civibot
Copy link

civibot bot commented Jun 4, 2021

(Standard links)

@civibot civibot bot added the master label Jun 4, 2021
*
* @param int $entityRoleId
* ID of the EntityRole record to be deleted.
*
*/
public static function del($entityRoleId) {
$entityDAO = new CRM_ACL_DAO_EntityRole();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be we should remove this function OR add a warning that says:

\CRM_Core_Error::deprecatedWarning(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated, use ' . __CLASS__ . '::deleteRecord.' ); 

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah - I think the api v3 would hit that? I'm happy to merge as is & we can look at that as a follow up

Comment on lines 75 to 87
$entityDAO = new self();
$entityDAO->id = $entityRoleId;
$entityDAO->find(TRUE);
$entityDAO->delete();
}

/**
* @param array $record
* @return CRM_Contact_DAO_DashboardContact
* @throws CRM_Core_Exception
*/
public static function deleteRecord(array $record) {
return parent::deleteRecord($record);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$entityDAO = new self();
$entityDAO->id = $entityRoleId;
$entityDAO->find(TRUE);
$entityDAO->delete();
}
/**
* @param array $record
* @return CRM_Contact_DAO_DashboardContact
* @throws CRM_Core_Exception
*/
public static function deleteRecord(array $record) {
return parent::deleteRecord($record);
return parent::deleteRecord(['id' => $entityRoleId]);

@monishdeb monishdeb force-pushed the add_aclrole_api4_entity branch from 57f6ced to 29a0c5c Compare June 4, 2021 19:50
@eileenmcnaughton eileenmcnaughton merged commit f3f0233 into civicrm:master Jun 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants