Closed (fixed)
Project:
CRM - Contact Relationship Management
Version:
1.0.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
13 Nov 2025 at 19:00 UTC
Updated:
27 Jan 2026 at 20:24 UTC
Jump to comment: Most recent
Comments
Comment #3
jdleonardComment #4
jdleonardComment #5
bluegeek9 commentedInterfaces are suppose to have the namespace prefixed to it, and end it Interface.
Comment #6
bluegeek9 commentedComment #7
jdleonard@bluegeek9 agreed on Interface suffix. However, Drupal's coding standards states "interfaces should have names that stand alone to tell what they do without having to refer to the namespace".
Comment #8
bluegeek9 commentedThe Event class probably should be renamed.
DatabaseQueryCondition (Database doesn't add to understanding)
DatabaseDriver (ambiguous/misleading)
EntityInterface
EntityClass (unnecessary words)
Threading (not ending in Test)
I recall drupal-check would flag interfaces that are not prefixed with the namespace as wrong. At some point there was an issue with running drupal-check in the pipeline, and I removed. Does drupal-check no longer mark it as a standards violation?
The author of drupal-check is ranked 15th
Comment #9
jdleonard"The Event class probably should be renamed." -- are you referring to "UserContactEvent"? What do you propose?
I propose that everything "UserContact" be renamed to "UserContactMapping" for clarity (so UserContactEvent would become UserContactMappingEvent), but that would probably be best as a follow up issue. Created #3558073: Rename "User Contact" to "User Contact Mapping"
I don't think what drupal-check flags is relevant if it doesn't match the current published coding standards.
Comment #10
jdleonardAlmost forgot: consider https://www.drupal.org/project/hook_event_dispatcher in lieu of defining UserContactEvent
Comment #11
bluegeek9 commentedThe custom event is not just because it is a hook. A custom event allows control over if the event if fired.
I do not want any additional hard dependencies.
The author of drupal-check is ranked 15th
Comment #12
jdleonardI can understand not wanting to add dependencies. To be clear, my suggestion of Hook Event Dispatcher would be to eliminate the need to define a custom event; the conditional logic could be moved to the event listener. Regardless, that's a stylistic choice that I don't see as particularly important.
Can you please clarify whether you are stating that all the interfaces should be prefixed with "Crm" or what other work you feel is needed here?
I had marked this a beta blocker because changing class/interface names could break backward compatibility once we're in beta. Do you disagree?
Comment #13
bluegeek9 commentedCrmRelationshipInterface, CrmContactInterface, and CrmContactDetailInterface are identical. They should be replace with a single CrmInterface.
Comment #14
bluegeek9 commentedThe other entity related namespaces can be pushed into the entity namespace and drop Crm.
Comment #15
jdleonardThere's value in not combining CrmRelationshipInterface, CrmContactInterface, and CrmContactDetailInterface as they might not remain identical forever. For example, if #3547287: Contact Detail Confirmation State were to result in some known states represented by strings, those might belong in CrmContactDetailInterface.
I pushed a refactor of the namespaces of various classes and interfaces. I matched the pattern used by the Group module, which has a similar level of complexity in the Entity namespace.
LMK what you think!
Comment #16
jdleonardChanging class and interface names is a backward compatibility break so re-tagging this as a beta blocker.
Comment #18
bluegeek9 commentedThere are too many changes.
Classes are being put into the wrong namespaces.
Comment #19
jdleonardHappy to work on this with some more guidance.
Which ones are wrong? Do you disagree with the namespace conventions used by the Group module? I couldn't find a coding standard that contradicted the conventions adopted by Group. I used that as a reference given the similar level of complexity.
Clearly you disagree that this is a beta blocker. I'd appreciate understanding why. I already explained my reasoning.
Comment #20
svendecabooterI'm also in favor of refactoring the classes this way.
Removing the "Crm" prefix for classes seems logical and avoids clutter in the filenames.
Moving the entity-related classes into specific "Entity/Access", "Entity/ViewBuilder", etc... namespaces also cleans up the unsorted single folder they were in previously.
This would need to be decided on fairly quickly I think, since it blocks other contributions (which would have merge conflicts).
Also better to change it early on, rather than refactoring later, if things have stabilized more.
Comment #21
bluegeek9 commentedComment #26
bluegeek9 commented