UndefinedLinkTemplateException error on file delete page

Created on 2 September 2024, 3 months ago

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

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇨🇿Czech Republic Bohus Ulrych Pilsen (Czechia)

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024