Entity reference fields had two settings controlling the list of referenceable bundles :
- $settings['target_bundle'] on the field storage level (that only allowed one referenceable bundle)
- $settings['handler_settings']['target_bundles'] on the field level
The former has been removed, and all behavior is now controlled by $settings['handler_settings']['target_bundles'] on the field level.
Configurable fields created in Field UI already have the information in the right place and need no change.
Base fields, defined in module code, that want to restrict referenceable entities to specific bundles (which should be a rare case, since code-defined fields usually do not hardcode behavior to specifc bundles, since bundles are defined by configuration in most cases), need to change their definition as follows :
Before:
$definition = BaseFieldDefinition::create('entity_reference')
->setSetting('target_type', 'node')
->setSetting('target_bundle', 'article');
After:
$definition = BaseFieldDefinition::create('entity_reference')
->setSetting('target_type', 'node')
->setSetting('handler_settings', ['target_bundles' => ['article' => 'article']]);