Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
TODO:
- Add "uid" entity key to contacts.
- Fix key check in CRMCorePermissions::entityTypePermissions.
- Rename "user" entity key to "uid" in activity entity.
- Add test coverage for new permissions
- ...
Comment | File | Size | Author |
---|---|---|---|
#4 | crm_core-2928452-3.patch | 11.96 KB | RoSk0 |
Comments
Comment #2
RoSk0Starting...
Comment #3
RoSk0First increment, no tests for new permissions but with fixes for current tests.
Decided to leave activity owner for now.
Comment #4
RoSk0Patch itself
Comment #5
grahlNeed to check if still relevant, obviously no longer applies
Comment #7
grahlEntityOwnerTrait is now in core and could be removed from crm_core, key switched to "owner" for that.
Comment #9
grahlTo update an existing site you can run this:
Comment #10
RoSk0In case someone would stumble upon comment #9 - it is not required. "Mismatched entity and/or field definitions" on a status report was because of the revisionable behaviour not set by default in core's EntityOwnerTrait::ownerBaseFieldDefinitions() for "uid" (owner) base field.
Revisionable behaviour was restored in https://git.drupalcode.org/project/crm_core/-/commit/22c40d0563521f73498...
Comment #11
sahaj CreditAttribution: sahaj commentedI'm still having:
Mismatched entity and/or field definitions
The following changes were detected in the entity type and field definitions.
Individual
The User ID field needs to be updated.
Organization
The User ID field needs to be updated.
If #9 not required, then what is required to get ride of these errors? I'm on Drupal 9.2.7 and the last crm_core dev.
Also tried the unrecommended (for that purpose) https://www.drupal.org/project/devel_entity_updates
Comment #12
bluegeek9 CreditAttribution: bluegeek9 as a volunteer commentedI was able to fix the error with the following code. The first time I ran it I got an error about uid being null, but it did create the column. I updated the uid field manually, and execute the code below again.