Open lcdservices opened 2 years ago
@lcdservices yes the multiple selection was by design. I'm pretty sure the first organization selected will be treated as the "primary" employer that gets the special treatment you described (if not, let me know I would consider that a bug). Can you say more about what breakage is caused by this?
there are several problems with this:
I'm having a hard time reproducing now, but what raised the issue was that a client was finding the current employer flag was getting inexplicably removed for some contacts. Those contacts only had one active employer relationship, and at one time it was definitely flagged as current. That may be a different issue going on (the removal of that flag) -- but it was impossible for the staff person to identify the issue because the summary tab was still listing the non-current-flagged org as the current employer. So there too -- the field was not doing or displaying what it was purported to be doing.
@lcdservices I think there might be a misunderstanding about the intent of this feature.
CiviCRM core has a limited notion of "Current Employer", that a person can only be employed by one company at a time. However, in the modern world that's not always true, so this extension expands that notion to "Current Employers" and can display and edit multiple employee/employer relationships at once. Instead of looking at the single-valued 'employer_id' field, this module checks for relationships, and displays as many as are current.
For people who want this ability, it's nice, but I can understand how you would be surprised by it if you're not expecting it. However, there really should be no change from core functionality as long as you never enter more than one employer for a person.
I would be in favor of expanding that notion of "Current Employers" so the module checks for relationships, and displays as many as are current.
@colemanw My issue with the current implementation is that it's misleading. It indicates it is the current employer field, when it's not -- i.e. it doesn't align with the core functionality regarding current employer. Regardless of whether people like or dislike the "one org as current" model (most of my clients definitely want to define a "primary" org for the contact and make use of that field in reports and exports -- so I suspect it's still widely used) -- the problem is that this implementation doesn't play well with that.
I think either the field should be relabeled to just "organizations" -- indicating it displays all active employee relationships, not just the current/primary org, or the functionality should follow existing core and implementers should use something like https://civicrm.org/extensions/relationship-block to decide if they want other relationships listed in full on the summary tab.
the problem is that this implementation doesn't play well with that.
I'm trying to understand exactly how it doesn't play well. If a person only has one employer, then there ought to be no difference. If you use this new field to remove their current employer and add a different one, then again, they will only have one and there will be no change. AFAIK the only time the user will notice any difference between this widget and the core widget is in the rare case that a person is actively employed by more than one org. And in that case IMO it is correct to show all of them. What am I missing?
The current employer field currently allows the user to select multiple organizations. It seems that decision may have come from this discussion: https://github.com/civicrm/org.civicrm.contactlayout/issues/22
That breaks the core concept of current employer. When an employer/employee relationship is flagged as the current employer, Civi stores the organization ID in civicrm_contact.employer_id and caches the org name in civicrm_contact.organization_name. That model doesn't support multiple IDs. While you can still navigate to the relationship tab and select which (of multiple) organizations is the "current" employer -- that is cumbersome and unexpected. One would expect that the selection under the current employer field in the inline block is in fact flagging a contact as a current employer. This has a trickle down effect in other places where current employer is used (tokens, exports, reports, etc.).
I think the entityRef field where current employer is defined should have multiple = FALSE in order to restore the core behavior.