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

CommentFileSizeAuthor
#6 2855855-6.patch687 bytesWim Leers
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hitfactory created an issue. See original summary.

Wim Leers’s picture

Category: Bug report » Support request
Status: Active » Postponed (maintainer needs more info)

Do you have modules installed that affect CSS and JS assets? Such as the advagg module?

hitfactory’s picture

Yes. You can see in the trace above that advagg/src/Asset/CssCollectionRenderer.php is being called.

Wim Leers’s picture

Title: Notice: Undefined index: preprocess in cdn_file_url_alter() » [PP-1] Notice: Undefined index: preprocess in cdn_file_url_alter()
Category: Support request » Task
Priority: Normal » Minor
Status: Postponed (maintainer needs more info) » Postponed
Related issues: +#2842347: Notice: Undefined index: #tag when used with the "Advanced CSS/JS Aggregation" module

Sorry, 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!

Wim Leers’s picture

Wim Leers’s picture

Title: [PP-1] Notice: Undefined index: preprocess in cdn_file_url_alter() » Notice: Undefined index: preprocess in cdn_file_url_alter()
Status: Postponed » Needs review
FileSize
687 bytes

Actually, 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 your settings.local.php for example.

The fix is trivial.

  • Wim Leers committed 5b1858d on 8.x-3.x
    Issue #2855855 by Wim Leers, hitfactory: Notice: Undefined index:...
Wim Leers’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.