Problem
The actual video is not being loaded on clicking the "Show content" message. Tested on a vanilla drupal 8.8
Steps to reproduce
- Install media_library
- Enable "Embed media" filter and add "Insert from media button" to ckeditor in "/admin/config/content/formats/manage/basic_html" / Alternatively add a media reference field
- Install cookie_content_blocker_media
- Check "Block YouTube media" in "/admin/config/system/cookie-content-blocker/media"
- Select "Cookie Content Blocker - oEmbed content" formatter in "/admin/structure/media/manage/remote_video/display"
- Add oembed media to node via ckeditor / Alternatively add oembed media to media reference field
- Find cookie content message when viewing node
- Click on "Show content" nothing happens, no JS error, no log message - I would expect the video to be loaded
If relevant: Enabling "Show a preview for blocked content" in "/admin/config/system/cookie-content-blocker/media" does make a preview appear.
Am I missing something? If not, this seems to be a bug report.
(I'm seeing around 20 of this notice after cache rebuild and then visiting a node with cookie content blocker)
Notice: Undefined index: weight in Drupal\Core\Asset\AssetResolver::sort() (line 385 of /var/www/html.original/core/lib/Drupal/Core/Asset/AssetResolver.php)
#0 /var/www/html.original/core/includes/bootstrap.inc(600): _drupal_error_handler_real(8, 'Undefined index...', '/var/www/html.o...', 385, Array)
#1 /var/www/html.original/core/lib/Drupal/Core/Asset/AssetResolver.php(385): _drupal_error_handler(8, 'Undefined index...', '/var/www/html.o...', 385, Array)
#2 [internal function]: Drupal\Core\Asset\AssetResolver::sort(Array, Array)
#3 /var/www/html.original/modules/contrib/cookie_content_blocker/src/Render/HtmlResponseAttachmentsProcessor.php(261): uasort(Array, Array)
#4 /var/www/html.original/modules/contrib/cookie_content_blocker/src/Render/HtmlResponseAttachmentsProcessor.php(225): Drupal\cookie_content_blocker\Render\HtmlResponseAttachmentsProcessor->getMergedAndSortedAssets(Array, Array, Array)
#5 /var/www/html.original/modules/contrib/cookie_content_blocker/src/Render/HtmlResponseAttachmentsProcessor.php(305): Drupal\cookie_content_blocker\Render\HtmlResponseAttachmentsProcessor->getJsAssetCollection('header')
#6 /var/www/html.original/modules/contrib/cookie_content_blocker/src/Render/HtmlResponseAttachmentsProcessor.php(139): Drupal\cookie_content_blocker\Render\HtmlResponseAttachmentsProcessor->processScripts()
#7 /var/www/html.original/core/lib/Drupal/Core/Render/HtmlResponseAttachmentsProcessor.php(161): Drupal\cookie_content_blocker\Render\HtmlResponseAttachmentsProcessor->processAssetLibraries(Object(Drupal\Core\Asset\AttachedAssets), Array)
#8 /var/www/html.original/core/modules/big_pipe/src/Render/BigPipeResponseAttachmentsProcessor.php(94): Drupal\Core\Render\HtmlResponseAttachmentsProcessor->processAttachments(Object(Drupal\Core\Render\HtmlResponse))
#9 /var/www/html.original/core/lib/Drupal/Core/EventSubscriber/HtmlResponseSubscriber.php(45): Drupal\big_pipe\Render\BigPipeResponseAttachmentsProcessor->processAttachments(Object(Drupal\Core\Render\HtmlResponse))
#10 [internal function]: Drupal\Core\EventSubscriber\HtmlResponseSubscriber->onRespond(Object(Symfony\Component\HttpKernel\Event\FilterResponseEvent), 'kernel.response', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#11 /var/www/html.original/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\FilterResponseEvent), 'kernel.response', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#12 /var/www/html.original/vendor/symfony/http-kernel/HttpKernel.php(191): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.response', Object(Symfony\Component\HttpKernel\Event\FilterResponseEvent))
#13 /var/www/html.original/vendor/symfony/http-kernel/HttpKernel.php(173): Symfony\Component\HttpKernel\HttpKernel->filterResponse(Object(Drupal\Core\Render\HtmlResponse), Object(Symfony\Component\HttpFoundation\Request), 1)
#14 /var/www/html.original/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#15 /var/www/html.original/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 /var/www/html.original/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 /var/www/html.original/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 /var/www/html.original/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#19 /var/www/html.original/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 /var/www/html.original/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#21 /var/www/html.original/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#22 /var/www/html.original/core/lib/Drupal/Core/DrupalKernel.php(694): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 /var/www/html.original/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#24 {main}