Problem/Motivation
EntityTypeManager::getDefinition() throws LogicException ("Bundle entity types are not supported directly.") as soon as the id contains :. It does this before looking at $exception_on_invalid.
hasDefinition() calls getDefinition($id, FALSE) and is supposed to return a boolean. For an id such as station:uuid it throws instead.
EntityConverter::applies() strips the entity: prefix and passes the rest to hasDefinition(). A route parameter of type entity:station:uuid therefore fatals during route building. The same happens for any entity:{type}:uuid converter.
Proposed resolution
When the id contains : and $exception_on_invalid is FALSE, return NULL. Keep throwing LogicException when the flag is TRUE.
Remaining tasks
- Review
User interface changes
None.
API changes
EntityTypeManager::hasDefinition() returns FALSE for ids that contain a colon, instead of throwing.
Data model changes
None.
Issue fork drupal-3633790
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
quietone commentedHi, Issues for Drupal core should be targeted to the 'main' branch, our primary development branch. Changes are made on the main branch first, and are then back ported as needed according to the Core change policies. The version the problem was discovered on should be stated in the issue summary Problem/Motivation section. Thanks.