Rename CRM User to be more clear

Created on 19 May 2025, 4 days ago

Problem/Motivation

The name "CRM User" doesn't convey what it represents: a mapping between a CRM Contact and Drupal core's User.

Proposed resolution

Rename it. Examples:

  • id (and base_table) "crm_user" to "crm_contact_user"
  • label "CRM User" to "Contact User Mapping" (or "CRM Contact User Mapping")
  • class name "User" to "ContactUser"

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ“Œ Task
Status

Active

Version

1.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States jdleonard Austin, TX, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @jdleonard
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States bluegeek9
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States jdleonard Austin, TX, USA

    Good change!

  • haritha c โ†’ made their first commit to this issueโ€™s fork.

  • Merge request !29Filename update โ†’ (Open) created by Unnamed author
  • Merge request !30updated the label and file names โ†’ (Closed) created by Unnamed author
  • Pipeline finished with Failed
    3 days ago
    Total: 280s
    #501409
  • Pipeline finished with Failed
    3 days ago
    #501408
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States jdleonard Austin, TX, USA

    Haritha, thanks for your contribution. Please close one MR and focus on just one MR/branch.

    There remain many references in the project to crm_user_contact, "CRM User", etc. These all need to reflect the name change. This should help get the tests passing.

  • Pipeline finished with Success
    2 days ago
    Total: 320s
    #502480
  • Pipeline finished with Success
    2 days ago
    Total: 381s
    #502487
  • Hi @jdleonard, Thank you for your guidance. I have updated all references from `crm_user` to `crm_user_contact` across the codebase and resolved the pipeline issues. The changes are included in MR !29. Please review MR !29. If any further changes are required, please let me know.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States jdleonard Austin, TX, USA

    Thanks Haritha.

    Please "close" MR 30 to avoid confusion.

    I have not performed a detailed review, but here are some outstanding needs.

    For the remaining MR, please note items 2 and 4 from Creating Merge Requests โ†’ .

    Classes such as CrmUserEvent and CrmUserInterface need renaming.

    Variables such as `crm_user` and `$crm_user_storage` need renaming.

    Any use of "Contact User" should be "User Contact". I updated the issue summary to remove a contradiction that may have introduced this.

    It would also be helpful to hear what steps you took to test that the relevant features continue to function.

  • Pipeline finished with Failed
    2 days ago
    Total: 279s
    #502514
  • Pipeline finished with Success
    about 18 hours ago
    Total: 409s
    #503523
  • @jdleonard, thank you for your feedback in comment #9.
    Iโ€™ve updated MR !29 with all requested fixes:
    Closed MR !30: Closed to consolidate changes in MR !29.
    Renamed Classes:
    CrmUserEvent to CrmUserContactEvent in src/Event/CrmUserEvent.php.
    CrmUserInterface to CrmUserContactInterface (or clarified its usage).
    Renamed Variables:
    Updated crm_user, $crm_user_storage to crm_user_contact, $crm_user_contact_storage in crm.module, crm.install, etc.
    Corrected Terminology:
    Replaced "Contact User" with "User Contact" in crm.schema.yml, Views, and labels.
    Cleaned References:
    Used grep -r "crm_user" . and grep -r "CrmUser" . to update all instances to crm_user_contact and CrmUserContact.

    Testing Steps: In my local Drupal environment (/d/xampp/htdocs/DrupalContribution):
    Installed the module (drush en crm, drush cr).
    Configured auto_create_crm_user_contact at /admin/config/crm/user/settings and verified the form.
    Checked /admin/config/crm/user for correct CrmUserContact entity display (id, user, crm_contact).
    Created a user at /admin/people/create and confirmed automatic CrmUserContact creation.
    Tested add/edit/delete at /admin/config/crm/user/add, /admin/config/crm/user/[id]/edit, /admin/config/crm/user/[id]/delete.
    Verified user deletion removes CrmUserContact entities.
    Confirmed name formatting on user profiles (/user/[uid]).
    Checked permissions at /admin/people/permissions for CRM access.

    All features work as expected, and pipeline issues are resolved. Please review MR !29. Let me know if further changes are needed!

Production build 0.71.5 2024