CRM-14753 API (relationship, create) of type "Employee of" does not set the employer_id

    Details

    • Type: Bug
    • Status: Open
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: 4.4.4
    • Fix Version/s: Unscheduled
    • Component/s: CiviCRM API
    • Labels:
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding

      Description

      An API call to create an employment relationship between an Individual and an Organization does not set the 'employer_id' and 'organization_name' columns in the contact table for the employee record.

      Reproduced on the demo site using the API explorer. Create an employment relationship, then go on the contact summary for the Individual, the 'Employer' field is empty, but the relationship tab shows that the employment relationship does exist. Tested with start_date and end_date for the relationship not set in the API call.

      This seems to be a regression from the 4.2 LTS.

        Attachments

          Activity

          [CRM-14753] API (relationship, create) of type "Employee of" does not set the employer_id
          Eileen McNaughton added a comment -

          I'm going to have to patch-welcome you on this one - it's obviously not tested...

          Eileen McNaughton added a comment -

          am unassigning JIRA tickets I'm not committed to working on

          Coleman Watts added a comment -

          I checked the code and setting current_employer is still being handled at the form level and not the BAO, so it's not available to the api.
          There are a couple fixmes in the code about this. Patches still welcome

            People

            • Assignee:
              Unassigned
              Reporter:
              Nicolas Ganivet

              Dates

              • Created:
                Updated: