by eggsurplus

Control what your users can access and save time, money, and frustrations. Lock down sensitive data in SugarCRM or SuiteCRM to specific groups or teams. Supports unlimited assigned users, unlimited group assignments to records, custom layouts for each group, login/sudo capabilities and much more.

Free 30 day trial
Try it Now

By clicking you consent to share your profile with the developer

#1720 - after_relationship_delete event between user and security group is not working

Closed Bug? created by so_removed_7 8 years ago

Hi,

I am facing problem using after_relationship_delete event between user and security group.

When I unlink secuity group from user from user management I see this unlinking is linked to this file : "include/generic/DeleteRelationship.php" line number "89" But after that after_relationship_delete event is not running

But when I try to unlink from user bean

$rel_name = 'SecurityGroups'; $user = new User (); $user->retrieve ( $userId ); $user->load_relationship ( $rel_name ); $user->$rel_name->delete ( $user->id,$securityGroupId);

Please help

  1. eggsurplus member avatar

    eggsurplus Provider Affiliate

    8 years ago

    Hi there,

    I'm not sure how to help here. It sounds like there may be a bug in Sugar that you are running into if the hook isn't firing. One thing to check to be safe is to try doing an after_relationship_delete on a different module and see if that test works. On the SecurityGroups module, try defining the hook on the other module.

    • so_removed_7 member avatar

      so_removed_7

      8 years ago

      it works for all modules when I try to unlink from user bean

      $rel_name = 'SecurityGroups'; $user = new User (); $user->retrieve ( $userId ); $user->load_relationship ( $rel_name ); $user->$rel_name->delete ( $user->id,$securityGroupId);

      Its just not working when calling from "include/generic/DeleteRelationship.php" line number "89"

      Thanks anyway

    • eggsurplus member avatar

      eggsurplus Provider Affiliate

      8 years ago

      Have you tried remove() instead? It will trigger data/Relationships/M2MRelationship.php->remove() which calls the before/after relationship delete hooks.

  2. eggsurplus member avatar

    eggsurplus Provider Affiliate

    7 years ago

    Closing this out, but feel free to follow up if you have any more questions.

This case is public. Please leave out any sensitive information such as URLs, passwords, etc.
Saving Comment Saving Comment...
Rating
Rating