"Show content" does not trigger unblocking content for oembed video

Created on 10 March 2020, over 4 years ago
Updated 13 April 2024, 7 months ago

Problem

The actual video is not being loaded on clicking the "Show content" message. Tested on a vanilla drupal 8.8

Steps to reproduce

  1. Install media_library
  2. 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
  3. Install cookie_content_blocker_media
  4. Check "Block YouTube media" in "/admin/config/system/cookie-content-blocker/media"
  5. Select "Cookie Content Blocker - oEmbed content" formatter in "/admin/structure/media/manage/remote_video/display"
  6. Add oembed media to node via ckeditor / Alternatively add oembed media to media reference field
  7. Find cookie content message when viewing node
  8. 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}
💬 Support request
Status

Postponed: needs info

Version

1.5

Component

Code

Created by

🇩🇪Germany anruether Bonn

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇱Netherlands steven buteneers

    Hi lexsoft,

    Please provide more information on how you are trying to implement this and what thirdparty services you might use.

  • 🇳🇱Netherlands Summit

    Hi, For me it is the google analytics cookies I want consent of the anonymous user. What settings do I need for Cookie Content Blocker with EU Cookie Compliance to work as such that the cookies are not placed until the user gives consent?
    My core.extention.yaml consists only out:

    module: {}
    theme: {}
    profile: ''
    

    Thanks for your reply in advance, and I do not want to hijack this issue, but it seems relevant, right? Greetings,

  • 🇨🇦Canada adriancid Montreal, Canada
  • 🇩🇪Germany demonde

    The Cookie Content Blocker module assumes you have configured integration with a cookie consent module of your choice, such as Cookiebot or EU Cookie Compliance. Until you configure this, 'Show content' will not trigger any change on the page.

    There is no hint on the modules website or the readme.md that the core functionality of this module does not work by itself. This is quite annoying.

Production build 0.71.5 2024