Crash errors on "managed not used" and "used not managed" links

Created on 9 November 2023, about 1 year ago
Updated 1 March 2024, 9 months ago

Problem/Motivation

Getting these errors in Drupal 10.1.5 install (upgraded from Drupal 9.5.11)

When I click on "managed not used":

TypeError:
count(): Argument #1 ($value) must be of type Countable|array, null given

  at /var/www/html/websites/drupal9/demo9/web/modules/contrib/auditfiles/src/Form/AuditFilesManagedNotUsedForm.php:142
  at count()
     (/var/www/html/websites/drupal9/demo9/web/modules/contrib/auditfiles/src/Form/AuditFilesManagedNotUsedForm.php:142)
  at Drupal\auditfiles\Form\AuditFilesManagedNotUsedForm->buildListForm()
     (/var/www/html/websites/drupal9/demo9/web/modules/contrib/auditfiles/src/Form/AuditFilesAuditorFormTrait.php:21)
  at Drupal\auditfiles\Form\AuditFilesManagedNotUsedForm->buildForm()
  at call_user_func_array()
     (/var/www/html/websites/drupal9/demo9/web/core/lib/Drupal/Core/Form/FormBuilder.php:536)
  at Drupal\Core\Form\FormBuilder->retrieveForm()
     (/var/www/html/websites/drupal9/demo9/web/core/lib/Drupal/Core/Form/FormBuilder.php:283)
  at Drupal\Core\Form\FormBuilder->buildForm()
     (/var/www/html/websites/drupal9/demo9/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/demo9/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:123)
  at Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
     (/var/www/html/websites/drupal9/demo9/web/core/lib/Drupal/Core/Render/Renderer.php:592)
  at Drupal\Core\Render\Renderer->executeInRenderContext()
     (/var/www/html/websites/drupal9/demo9/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:124)
  at Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
     (/var/www/html/websites/drupal9/demo9/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:97)
  at Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
     (/var/www/html/websites/drupal9/demo9/vendor/symfony/http-kernel/HttpKernel.php:181)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (/var/www/html/websites/drupal9/demo9/vendor/symfony/http-kernel/HttpKernel.php:76)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (/var/www/html/websites/drupal9/demo9/web/modules/custom/sbn/src/Middleware/Redirect.php:19)
  at Drupal\sbn\Middleware\Redirect->handle()
     (/var/www/html/websites/drupal9/demo9/web/core/lib/Drupal/Core/StackMiddleware/Session.php:58)
  at Drupal\Core\StackMiddleware\Session->handle()
     (/var/www/html/websites/drupal9/demo9/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php:48)
  at Drupal\Core\StackMiddleware\KernelPreHandle->handle()
     (/var/www/html/websites/drupal9/demo9/web/core/modules/page_cache/src/StackMiddleware/PageCache.php:106)
  at Drupal\page_cache\StackMiddleware\PageCache->pass()
     (/var/www/html/websites/drupal9/demo9/web/core/modules/page_cache/src/StackMiddleware/PageCache.php:85)
  at Drupal\page_cache\StackMiddleware\PageCache->handle()
     (/var/www/html/websites/drupal9/demo9/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php:48)
  at Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
     (/var/www/html/websites/drupal9/demo9/web/modules/contrib/tracer/src/StackMiddleware/TracesMiddleware.php:42)
  at Drupal\tracer\StackMiddleware\TracesMiddleware->handle()
     (/var/www/html/websites/drupal9/demo9/web/modules/contrib/webprofiler/src/StackMiddleware/WebprofilerMiddleware.php:34)
  at Drupal\webprofiler\StackMiddleware\WebprofilerMiddleware->handle()
     (/var/www/html/websites/drupal9/demo9/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php:51)
  at Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
     (/var/www/html/websites/drupal9/demo9/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php:51)
  at Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
     (/var/www/html/websites/drupal9/demo9/web/core/lib/Drupal/Core/DrupalKernel.php:704)
  at Drupal\Core\DrupalKernel->handle()
     (/var/www/html/websites/drupal9/demo9/web/index.php:19)                

In addition:

Warning: Undefined variable $rows in Drupal\auditfiles\Form\AuditFilesManagedNotUsedForm->buildListForm() (line 142 of modules/contrib/auditfiles/src/Form/AuditFilesManagedNotUsedForm.php).
Drupal\auditfiles\Form\AuditFilesManagedNotUsedForm->buildListForm(Array, Object) (Line: 21)
Drupal\auditfiles\Form\AuditFilesManagedNotUsedForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm('audit_files_managed_not_used', Object) (Line: 283)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 592)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 19)
Drupal\sbn\Middleware\Redirect->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 42)
Drupal\tracer\StackMiddleware\TracesMiddleware->handle(Object, 1, 1) (Line: 34)
Drupal\webprofiler\StackMiddleware\WebprofilerMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

When I click on "used not managed":

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

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

Steps to reproduce

I had a Drupal 9.5.9 site where audit files was working. Upgraded Drupal to 9.5.11 then 10.5.1. Upgraded Audit Files to 4.1.0-beta1. That's all I can think of.

Note that I do have another 10.5.1 site running Audit Files 4.1.0-beta1 and am NOT getting this error on it. Not sure how to troubleshoot.

🐛 Bug report
Status

Needs review

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

  • Issue created by @somebodysysop
  • 🇺🇸United States somebodysysop

    Also found I am getting this warning:

    Warning: Undefined variable $rows in Drupal\auditfiles\Form\AuditFilesManagedNotUsedForm->buildListForm() (line 142 of modules/contrib/auditfiles/src/Form/AuditFilesManagedNotUsedForm.php).
    Drupal\auditfiles\Form\AuditFilesManagedNotUsedForm->buildListForm(Array, Object) (Line: 21)
    Drupal\auditfiles\Form\AuditFilesManagedNotUsedForm->buildForm(Array, Object)
    call_user_func_array(Array, Array) (Line: 536)
    Drupal\Core\Form\FormBuilder->retrieveForm('audit_files_managed_not_used', Object) (Line: 283)
    Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
    Drupal\Core\Controller\FormController->getContentResult(Object, Object)
    call_user_func_array(Array, Array) (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 592)
    Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 19)
    Drupal\sbn\Middleware\Redirect->handle(Object, 1, 1) (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 42)
    Drupal\tracer\StackMiddleware\TracesMiddleware->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

  • Status changed to Needs review 9 months ago
  • 🇮🇳India dineshkumarbollu

    Created will fix the issue, please review.

  • 🇺🇸United States somebodysysop

    Thank you for the patch.

    Managed not used no longer issues error.

    Used not managed, however, results in this:

    No link template 'canonical' found for the 'paragraph' entity type

Production build 0.71.5 2024