Used not managed report generates error

Created on 17 August 2024, 4 months ago

Problem/Motivation

I want to remove files that are on my server that are not managed, but Audit Files generates a runtime error when I select "Used not managed".

Steps to reproduce

In my system, files are uploaded to paragraphs which are attached to nodes.

I have files which were initially uploaded to a paragraph then removed. The files still remain on the server. The files no longer appear in the file_managed table, but the fids for these files do appear in the file_usage table. When I go to Audit Files and select "Used not managed" report, I get this error:

Drupal\Core\Entity\Exception\UndefinedLinkTemplateException:
No link template 'canonical' found for the 'paragraph' entity type

at /var/www/html/websites/drupal9/master/web/core/lib/Drupal/Core/Entity/EntityBase.php:196
at Drupal\Core\Entity\EntityBase->toUrl()
(/var/www/html/websites/drupal9/master/web/core/lib/Drupal/Core/Entity/EntityBase.php:244)
at Drupal\Core\Entity\EntityBase->toLink()
(/var/www/html/websites/drupal9/master/web/modules/contrib/auditfiles/src/Form/AuditFilesUsedNotManagedForm.php:130)
at Drupal\auditfiles\Form\AuditFilesUsedNotManagedForm->Drupal\auditfiles\Form\{closure}()
at array_reduce()
(/var/www/html/websites/drupal9/master/web/modules/contrib/auditfiles/src/Form/AuditFilesUsedNotManagedForm.php:140)
at Drupal\auditfiles\Form\AuditFilesUsedNotManagedForm->buildListForm()
(/var/www/html/websites/drupal9/master/web/modules/contrib/auditfiles/src/Form/AuditFilesAuditorFormTrait.php:21)
at Drupal\auditfiles\Form\AuditFilesUsedNotManagedForm->buildForm()
at call_user_func_array()
(/var/www/html/websites/drupal9/master/web/core/lib/Drupal/Core/Form/FormBuilder.php:536)
at Drupal\Core\Form\FormBuilder->retrieveForm()
(/var/www/html/websites/drupal9/master/web/core/lib/Drupal/Core/Form/FormBuilder.php:283)
at Drupal\Core\Form\FormBuilder->buildForm()
(/var/www/html/websites/drupal9/master/web/core/lib/Drupal/Core/Controller/FormController.php:73)
at Drupal\Core\Controller\FormController->getContentResult()
at call_user_func_array()
(/var/www/html/websites/drupal9/master/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:123)
at Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
(/var/www/html/websites/drupal9/master/web/core/lib/Drupal/Core/Render/Renderer.php:592)
at Drupal\Core\Render\Renderer->executeInRenderContext()
(/var/www/html/websites/drupal9/master/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:124)
at Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
(/var/www/html/websites/drupal9/master/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:97)
at Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
(/var/www/html/websites/drupal9/master/vendor/symfony/http-kernel/HttpKernel.php:181)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
(/var/www/html/websites/drupal9/master/vendor/symfony/http-kernel/HttpKernel.php:76)
at Symfony\Component\HttpKernel\HttpKernel->handle()
(/var/www/html/websites/drupal9/master/web/modules/custom/sbn/src/Middleware/Redirect.php:19)
at Drupal\sbn\Middleware\Redirect->handle()
(/var/www/html/websites/drupal9/master/web/core/lib/Drupal/Core/StackMiddleware/Session.php:58)
at Drupal\Core\StackMiddleware\Session->handle()
(/var/www/html/websites/drupal9/master/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php:48)
at Drupal\Core\StackMiddleware\KernelPreHandle->handle()
(/var/www/html/websites/drupal9/master/web/core/modules/page_cache/src/StackMiddleware/PageCache.php:106)
at Drupal\page_cache\StackMiddleware\PageCache->pass()
(/var/www/html/websites/drupal9/master/web/core/modules/page_cache/src/StackMiddleware/PageCache.php:85)
at Drupal\page_cache\StackMiddleware\PageCache->handle()
(/var/www/html/websites/drupal9/master/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php:48)
at Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
(/var/www/html/websites/drupal9/master/web/modules/contrib/tracer/src/StackMiddleware/TracesMiddleware.php:38)
at Drupal\tracer\StackMiddleware\TracesMiddleware->handle()
(/var/www/html/websites/drupal9/master/web/modules/contrib/webprofiler/src/StackMiddleware/WebprofilerMiddleware.php:40)
at Drupal\webprofiler\StackMiddleware\WebprofilerMiddleware->handle()
(/var/www/html/websites/drupal9/master/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php:51)
at Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
(/var/www/html/websites/drupal9/master/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php:51)
at Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
(/var/www/html/websites/drupal9/master/web/core/lib/Drupal/Core/DrupalKernel.php:704)
at Drupal\Core\DrupalKernel->handle()
(/var/www/html/websites/drupal9/master/web/index.php:19)

Proposed resolution

I need a resolution. Similar issues with "Used not referenced" and "Managed not used" in this issue: https://www.drupal.org/project/auditfiles/issues/3339733 πŸ› Used Not Referenced Report Generates Error Needs review

But so far, after 9 months, nothing for "Used not managed".

πŸ› Bug report
Status

Active

Version

4.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States somebodysysop

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

Comments & Activities

Production build 0.71.5 2024