CRM-15881 Deactivating "employee of" relationship does not take off current employer

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.5
    • Fix Version/s: 4.6.4
    • Component/s: None
    • Labels:
      None
    • Documentation Required?:
      None

      Description

      Deactivating "employee of" relationship does not take off current employer, thus membership by relationship "employee of" is not taken off the contact either.

      Currently, only ticking of the current employer tickbox in the relationship does the job.

        Attachments

          Activity

          [CRM-15881] Deactivating "employee of" relationship does not take off current employer
          Guanhuan Chen added a comment -

          After testing I found that disabling any relationship will not remove the membership based on that relationship.

          Coleman Watts added a comment -

          Have you reproduced this bug on the sandbox site?
          See https://civicrm.org/bug-reporting

          Guanhuan Chen added a comment -

          Hi @coleman,

          I have managed to reproduced both this issue and CRM-15829 (which is a bit similar but not quite) on Civi4.5 sandbox when I report them. Just to make sure, I have just recreated these issue on the Master Drupal sandbox as well which is 4.6. I think both of them are outstanding.

          Coleman Watts added a comment -

          Ok checking up on this, it looks like there are multiple things to address here:

          • The enable/disable menu item uses the "setvalue" api action which is not very smart and doesn't tend to trigger updates of related data
          • The edit form allows "current employer" to be checked even if "enabled" is un-checked. Probably the correct behavior would be to hide the "current employer" field if "enabled" is un-checked.
          • What to do about past end-dates? There is a cron job to disable relationships with past end dates - we should make sure that behaves consistently with whatever we decide.
          Guanhuan Chen added a comment -

          After Discussion, we get the conclusion that both the actions (Disabling relationship & deleting relationship) should take the current employer of the contact.

          Also, an disabled relationship should not be allowed to become the current employment relationship.

          Please find the screenshots.

          David Greenberg added a comment -

          Note that inherited memberships are based on relationship type + is_active status. The 'current employer' flag is NOT considered in determining whether an inherited membership is granted. There is an open (in QA issue) to correct a bug related to inherited memberships and relationship disabling:

          https://issues.civicrm.org/jira/browse/CRM-16306

          Currently, setting a past End Date on a relationship in the Edit Relationship form does not automatically set is_active = FALSE, and therefore does NOT affected inherited memberships. I agree that this is a bug and should be fixed.

          I also agree that disabling a relationship should also unset the current employee flag. A PR to fix these behaviors would be great.

          Guanhuan Chen added a comment -

          Hi Dave,

          Yes. We realise that the inherited memberships by relationship issue that was related to this issue has now been fixed. Therefore, this issue is now purely a bug with the current employer change by the actions to the employment relationship. Our team will try fix this and send a PR through.

          Thanks.
          Guanhuan

            People

            • Assignee:
              David Greenberg
              Reporter:
              Guanhuan Chen

              Dates

              • Created:
                Updated:
                Resolved: