Seeing these notices in our logs since enabling the CDN module. Full message below.
Notice: Undefined index: preprocess in cdn_file_url_alter() (line 42 of /app/web/modules/contrib/cdn/cdn.module) #0 /app/web/core/includes/bootstrap.inc(548): _drupal_error_handler_real(8, 'Undefined index...', '/app/web/module...', 42, Array) #1 /app/web/modules/contrib/cdn/cdn.module(42): _drupal_error_handler(8, 'Undefined index...', '/app/web/module...', 42, Array) #2 /app/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(501): cdn_file_url_alter('public://css/cs...', NULL, NULL) #3 /app/web/core/includes/file.inc(185): Drupal\Core\Extension\ModuleHandler->alter('file_url', 'public://css/cs...') #4 /app/web/modules/contrib/advagg/src/Asset/CssCollectionRenderer.php(123): file_create_url('public://css/cs...') #5 /app/web/modules/contrib/http2_server_push/src/Asset/CssCollectionRenderer.php(47): Drupal\advagg\Asset\CssCollectionRenderer->render(Array) #6 /app/web/modules/contrib/advagg/src/Render/HtmlResponseAttachmentsProcessor.php(39): Drupal\http2_server_push\Asset\CssCollectionRenderer->render(Array) #7 /app/web/core/lib/Drupal/Core/Render/HtmlResponseAttachmentsProcessor.php(161): Drupal\advagg\Render\HtmlResponseAttachmentsProcessor->processAssetLibraries(Object(Drupal\Core\Asset\AttachedAssets), Array) #8 /app/web/modules/contrib/http2_server_push/src/Render/HtmlResponseAttachmentsProcessor.php(48): Drupal\Core\Render\HtmlResponseAttachmentsProcessor->processAttachments(Object(Drupal\Core\Render\HtmlResponse)) #9 /app/web/core/lib/Drupal/Core/EventSubscriber/HtmlResponseSubscriber.php(45): Drupal\http2_server_push\Render\HtmlResponseAttachmentsProcessor->processAttachments(Object(Drupal\Core\Render\HtmlResponse)) #10 /app/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): Drupal\Core\EventSubscriber\HtmlResponseSubscriber->onRespond(Object(Symfony\Component\HttpKernel\Event\FilterResponseEvent), 'kernel.response', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher)) #11 /app/vendor/symfony/http-kernel/HttpKernel.php(184): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.response', Object(Symfony\Component\HttpKernel\Event\FilterResponseEvent)) #12
Comment | File | Size | Author |
---|---|---|---|
#6 | 2855855-6.patch | 687 bytes | Wim Leers |
Comments
Comment #2
Wim LeersDo you have modules installed that affect CSS and JS assets? Such as the advagg module?
Comment #3
hitfactory CreditAttribution: hitfactory commentedYes. You can see in the trace above that advagg/src/Asset/CssCollectionRenderer.php is being called.
Comment #4
Wim LeersSorry, I wrote #2 on my phone, where I didn't use cmd+F.
We also had this problem over at #2842347: Notice: Undefined index: #tag when used with the "Advanced CSS/JS Aggregation" module, where it was also caused by Advagg. The Advagg module maintainer promised to review that. Let's postpone this on that issue.
And … lol, it's also you who reported that issue :D I knew I recognized your name from somewhere!
Comment #5
Wim LeersOnce #2859132: Error: Unsupported operand types in Drupal\advagg\Render\HtmlResponseAttachmentsProcessor->processAssetLibraries() (line 64) lands and you update your AdvAgg module, this problem will have disappeared.
I'm still considering whether porting similar "strictness checks" as the ones added in #2842347: Notice: Undefined index: #tag when used with the "Advanced CSS/JS Aggregation" module make sense for the CDN module.
Comment #6
Wim LeersActually, I think this is not related to AdvAgg after all. I think it's simply a small bug in the CDN module. A bug that doesn't cause problems, but that will cause noise: the notices in your logs.
It's possible that this happens if you are setting
$_GLOBALS['config']['system.performance']['gzip'] = FALSE
in yoursettings.local.php
for example.The fix is trivial.
Comment #8
Wim Leers