Drupal\Core\Entity\Plugin\EntityReferenceSelection\DefaultSelection::validateTargetBundles() is deprecated for removal in Drupal 13.0.0. Custom code that calls this method or registers it as an #element_validate callback must stop using it. There is no direct replacement: set the intended target_bundles value explicitly.
- For entity types without bundles, set the form value to
NULL. - For entity types with bundles,
NULLallows all bundles and[]allows none. Custom forms that allow all bundles must provide an explicit choice for that setting. Preserve[]for an empty selection, or require the user to correct it.
The callback converts [] to NULL, which can unintentionally allow every bundle after the last allowed bundle is deleted. It retains that behavior for backward compatibility but now triggers a deprecation notice. The default selection plugin no longer registers it.
The standard form still requires a bundle selection for entity types with bundles and now supplies NULL directly for bundleless types. The supported configuration values have not changed.