- Issue created by @rabindrakumar
- š®š³India rabindrakumar
The patch resolved the issue. I don't see any warning for this.
- last update
over 1 year ago Custom Commands Failed - Status changed to Postponed: needs info
over 1 year ago 8:47pm 19 July 2023 - last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago Custom Commands Failed - š®š³India rabindrakumar
Hi Cilefen,
This happened for me on Drupal 9.5.10 version and I am using PHP 8.1 and Database Version 10.4.25-MariaDB. My site was running with 9.5.9 and I started getting this warning after upgrading to 9.5.10 (Upgraded through composer).
- Status changed to Needs review
over 1 year ago 5:35pm 21 July 2023 - Status changed to Postponed: needs info
over 1 year ago 9:13pm 21 July 2023 - šŗšøUnited States smustgrave
Leaving steps to reproduce as the actual steps are not provided.
Also issue summary is incomplete.
No test case either.
- šŗšøUnited States maskedjellybean Portland, OR
The cause of this is an incorrectly formatted library name, likely in YOURTHEME.libraries.yml. Look for a library that does not follow this format: "MODULE_NAME/LIBRARY_NAME" (the forward slash is crucial). If you are able to step debug you could also add a breakpoint within
\Drupal\Core\Asset\LibraryDependencyResolver::doGetDependencies
(currently line 67). Refresh the page that triggers the error and continue debugging until you find that$library
does not follow the correct format. Search your codebase for the incorrect format and replace it if it is in a custom module or theme. If it is in a contrib module, open an issue there.Perhaps the goal of this ticket could be to have core throw a useful error message when this happens?
- šŗšøUnited States timkroehler
Can someone help me know how to make this patch application persist?
I added these lines under/patches
in composer.json, but the changes keep getting overwritten as I make changes in composer and update:"drupal/core": { "3329660 - Assetresolver": "https://www.drupal.org/files/issues/2022-12-26/3329660-2.patch" },
- Status changed to Active
9 months ago 2:13pm 11 March 2024 - šŖšøSpain eduardo morales alberti Spain, šŖšŗ
In our case, this happens when the library does not exist on Drupal because was removed.
Example of our case:
A search Ajax callback with a library that was removed:
https://example.com/search?ajax_page_state[theme]=radix&ajax_page_state[theme_token]=&ajax_page_state[libraries]=addtoany/addtoany.front&f[0]=type:article
When the library does not exist or is not a valid name, then it gives a warning.
Should be it fixed? Maybe not or maybe it should log which library is not available to leave to the admin decide what to do. - Merge request !7016Issue #3375666 by rabindrakumar: Warning: Undefined array key 1 in... ā (Open) created by eduardo morales alberti
- šŖšøSpain eduardo morales alberti Spain, šŖšŗ
Also covered the core/lib/Drupal/Core/Asset/LibraryDependencyResolver.php class, and continue if the extension or the name are not defined.
- šŖšøSpain eduardo morales alberti Spain, šŖšŗ
Added also array filter on HtmlResponseAttachmentsProcessor to avoid setting already loaded libraries when the array is empty.
[0 = ""]
- š®š¹Italy giordy
I have a similar warning with drupal 11.0.9 for every page visited. It must have appeared after one of the latest core updates.
The site with drupal 10.3.10 has the same pages and settings, but there is no warning.
I don't know how to fix it.Thank you
Warning: Undefined array key 1 in Drupal\Core\Asset\AssetResolver->getJsAssets() (line 243 of /home/hmcpdbiy/prova.gmpe.it/core/lib/Drupal/Core/Asset/AssetResolver.php) #0 /home/hmcpdbiy/prova.gmpe.it/core/includes/bootstrap.inc(108): _drupal_error_handler_real(2, 'Undefined array...', '/home/hmcpdbiy/...', 243) #1 /home/hmcpdbiy/prova.gmpe.it/core/lib/Drupal/Core/Asset/AssetResolver.php(243): _drupal_error_handler(2, 'Undefined array...', '/home/hmcpdbiy/...', 243) #2 /home/hmcpdbiy/prova.gmpe.it/core/lib/Drupal/Core/Render/HtmlResponseAttachmentsProcessor.php(286): Drupal\Core\Asset\AssetResolver->getJsAssets(Object(Drupal\Core\Asset\AttachedAssets), true, Object(Drupal\Core\Language\Language)) #3 /home/hmcpdbiy/prova.gmpe.it/core/lib/Drupal/Core/Render/HtmlResponseAttachmentsProcessor.php(123): Drupal\Core\Render\HtmlResponseAttachmentsProcessor->processAssetLibraries(Object(Drupal\Core\Asset\AttachedAssets), Array) #4 /home/hmcpdbiy/prova.gmpe.it/core/modules/big_pipe/src/Render/BigPipeResponseAttachmentsProcessor.php(97): Drupal\Core\Render\HtmlResponseAttachmentsProcessor->processAttachments(Object(Drupal\Core\Render\HtmlResponse)) #5 /home/hmcpdbiy/prova.gmpe.it/core/lib/Drupal/Core/EventSubscriber/HtmlResponseSubscriber.php(45): Drupal\big_pipe\Render\BigPipeResponseAttachmentsProcessor->processAttachments(Object(Drupal\Core\Render\HtmlResponse)) #6 /home/hmcpdbiy/prova.gmpe.it/vendor/symfony/event-dispatcher/EventDispatcher.php(246): Drupal\Core\EventSubscriber\HtmlResponseSubscriber->onRespond(Object(Symfony\Component\HttpKernel\Event\ResponseEvent), 'kernel.response', Object(Symfony\Component\EventDispatcher\EventDispatcher)) #7 /home/hmcpdbiy/prova.gmpe.it/vendor/symfony/event-dispatcher/EventDispatcher.php(206): Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher\{closure}(Object(Symfony\Component\HttpKernel\Event\ResponseEvent), 'kernel.response', Object(Symfony\Component\EventDispatcher\EventDispatcher)) #8 /home/hmcpdbiy/prova.gmpe.it/vendor/symfony/event-dispatcher/EventDispatcher.php(56): Symfony\Component\EventDispatcher\EventDispatcher->callListeners(Array, 'kernel.response', Object(Symfony\Component\HttpKernel\Event\ResponseEvent)) #9 /home/hmcpdbiy/prova.gmpe.it/vendor/symfony/http-kernel/HttpKernel.php(216): Symfony\Component\EventDispatcher\EventDispatcher->dispatch(Object(Symfony\Component\HttpKernel\Event\ResponseEvent), 'kernel.response') #10 /home/hmcpdbiy/prova.gmpe.it/vendor/symfony/http-kernel/HttpKernel.php(204): Symfony\Component\HttpKernel\HttpKernel->filterResponse(Object(Drupal\Core\Render\HtmlResponse), Object(Symfony\Component\HttpFoundation\Request), 1) #11 /home/hmcpdbiy/prova.gmpe.it/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #12 /home/hmcpdbiy/prova.gmpe.it/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #13 /home/hmcpdbiy/prova.gmpe.it/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #14 /home/hmcpdbiy/prova.gmpe.it/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #15 /home/hmcpdbiy/prova.gmpe.it/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #16 /home/hmcpdbiy/prova.gmpe.it/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #17 /home/hmcpdbiy/prova.gmpe.it/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #18 /home/hmcpdbiy/prova.gmpe.it/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #19 /home/hmcpdbiy/prova.gmpe.it/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #20 /home/hmcpdbiy/prova.gmpe.it/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #21 /home/hmcpdbiy/prova.gmpe.it/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #22 /home/hmcpdbiy/prova.gmpe.it/core/lib/Drupal/Core/DrupalKernel.php(709): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #23 /home/hmcpdbiy/prova.gmpe.it/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #24 {main}
- š¬š§United Kingdom catch
There's an MR here that needs work, changing status.