- Issue created by @Bohus Ulrych
After some core/module/PHP update stopped working file delete page/form.
Visiting URL /file/fid/delete triggers only error
Drupal\Core\Entity\Exception\UndefinedLinkTemplateException: Cannot generate default URL because no link template 'canonical' or 'edit-form' was found for the 'file' entity type in Drupal\Core\Entity\EntityBase->toUrl() (line 213 of core/lib/Drupal/Core/Entity/EntityBase.php).
I don't know what is core of this problem, but simple change of route from /file/{file}/delete to e.g. /file2/{file}/delete fix the problem.
Note: Strange is that edit page /file/{file}/edit works without any problem, but I see that it is implemented different way.
Tested with
Drupal 10.3.2
PHP 8.1.29
file_management 8.x-2.x-dev
Active
2.0
Code