Problem/Motivation
In farmOS 3.x we identified an issue with the way Drupal core maintains a map of bundle fields: #3314741: EntityFieldManager::getFieldMap() doesn't show farmOS bundle fields
The solution to this was to apply the Drupal core patch from #3129179: Provide some way to rebuild the persistent bundle field map. This added a new rebuildBundleFieldMap() method to the EntityFieldManager service, which we used to rebuild the bundle field map when modules were installed/uninstalled. We also recommended that downstream modules do the same.
In the meantime, Drupal core has fixed the root issue and there is no longer a need to maintain a map of bundle fields, and therefore rebuilding it is also unnecessary. See: #3045509: EntityFieldManager key/value field map gets out of sync, doesn't recognise bundle fields
The patch we were using no longer applies to Drupal 11.x, so we need to remove it. However, because we recommended the EntityFieldManager::rebuildBundleFieldMap() method to downstream farmOS module developers, removing it in farmOS 4.x would be a breaking change.
Proposed resolution
The appropriate strategy is to deprecate EntityFieldManager::rebuildBundleFieldMap() in farmOS 4.x, and remove it in farmOS 5.x.
This means we need to provide an empty version of the method ourselves, because a) the patch no longer applies, and b) we no longer need it to rebuild the field map.
We can do this in a decorator class and deprecate it for removal in farmOS 5.x per https://www.drupal.org/about/core/policies/core-change-policies/how-to-d....
Remaining tasks
- Replace patch with a decorator class that provides an empty method.
- Deprecate the class and method.
- Add a change record.
- Remove the class in farmOS 5.x.
User interface changes
None.
API changes
None.
Data model changes
None.
Comments
Comment #3
m.stentaThe deprecation was merged in https://github.com/farmOS/farmOS/pull/1074.
Postponing this until the 5.x branch is opened so we can remove the deprecated code...