Closed (fixed)
Project:
Asset Injector
Version:
8.x-2.19
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Feb 2024 at 15:35 UTC
Updated:
26 Jul 2024 at 16:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #3
pookmish commentedComment #4
hswong3i commentedI get following error message once fetching the latest 8.x-2.x-dev:
NOTICE: PHP message: Uncaught PHP Exception TypeError: "Drupal\Core\Render\Renderer::addCacheableDependency(): Argument #1 ($elements) must be of type array, null given, called in /var/www/html/modules/contrib/asset_injector/asset_injector.module on line 153" at /var/www/html/core/lib/Drupal/Core/Render/Renderer.php line 768After rolling back the patch, issue get fixed:
Comment #6
hswong3i commentedComment #7
pookmish commented@hswong3i, This sounds like you have something else going on. In the 8.x-2.x version, line 153 is a comment and the only thing added in the commit was adding a hook_preprocess_maintenance_page which works exactly like it's supposed to when using a base installation. You should debug your code first.
Comment #8
anybody@hswong3i any further details here? Can we set this fixed again?
Comment #9
hswong3i commentedComment #10
hswong3i commentedComment #11
pookmish commentedI added a unit test for the maintenance mode page assets. It works as expected. @hswong3i, if your site is sending "null" into the hook_preprocess_maintenance_page then you have other things that are breaking the functionality. Even Drupal core expects an array in the hooks for claro and olivero themes.