Problem/Motivation

Entity/field definitions: Mismatched entity and/or field definitions
Salesforce Mapped Object: The Mapped Entity field needs to be updated.

After upgrading to Drupal 10.5.6 with Salesforce 5.1.2, the status report shows a persistent entity/field definition mismatch error. I inherit this website and I am not sure exactly at wish version the error shows but I know this is showing with the last updates.

However, investigation reveals that the current and installed field definitions are **byte-for-byte identical** (matching SHA1 hashes), yet Drupal's entity definition update manager still reports change type 2 (DEFINITION_UPDATED).

Tested field definition comparison:
ddev drush php:eval "\$update_manager = \Drupal::entityDefinitionUpdateManager(); \$field_name = 'drupal_entity'; \$entity_type_id = 'salesforce_mapped_object'; \$storage_definition = \$update_manager->getFieldStorageDefinition(\$field_name, \$entity_type_id); if (\$storage_definition) { \$update_manager->installFieldStorageDefinition(\$field_name, \$entity_type_id, 'salesforce_mapping', \$storage_definition);}"

Version

  • Salesforce Suite:** 5.1.x-dev
  • Drupal Core:** 10.5.6
  • PHP:** 8.3.27
  • Dynamic Entity Reference:** 3.2.1

Field definition location: `/modules/contrib/salesforce/modules/salesforce_mapping/src/Entity/MappedObject.php:192`

Steps to reproduce

  1. Upgrade to Drupal 10.5.x with Salesforce 5.1.2 installed
  2. All update hooks complete successfully (salesforce_mapping schema version: 8004)
  3. Database schema is correct (all required columns exist)
  4. Check status report at `/admin/reports/status`
  5. Error appears despite definitions being identical

Proposed resolution

Need to investigate:
1. Why identical field definitions are flagged as different
2. Whether the comparison logic changed in Drupal 10.5.x
3. If `entity.last_installed_schema.repository` service needs to be updated alongside `entity.definitions.installed` key-value store
4. Whether this is specific to `dynamic_entity_reference` field types

Remaining tasks

User interface changes

API changes

Data model changes

Related Issues
- #3209156 - Similar issue, closed as outdated with recommendation to file new issue on 5.x
- #3415113 - Similar symptoms on Drupal 10, no definitive solution

Comments

anicoto created an issue.