By tstoeckler on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
10.2.x
Introduced in version:
10.2.0
Issue links:
Description:
EntityBase::toUrl() now supports entity types that do not provide a canonical link template but do provide an edit form link template. In this case, the edit form template is used when there is no $rel parameter. This allows modules that generically interact with entities of multiple types to call $entity->toUrl() and have it work as expected.
Entity types without a canonical link template and without a collection link template can now use the standard delete form. The cancel link will lead to the edit form of the entity.
No change for entity types with a canonical link template
$canonical = $entity->toUrl();
is the same as
$canonical = $entity->toUrl('canonical');
Entity types without a canonical link template
Before
$edit_form = $entity->toUrl();
This would throw a "No link template 'canonical' found" exception.
After
$edit_form = $entity->toUrl();
This is now the same as $edit_form = $entity->toUrl('edit-form');.
Impacts:
Module developers