Created on 11 May 2023, over 1 year ago
Updated 12 May 2023, over 1 year ago

Problem/Motivation

When the module is enabled on a site running on PHP 8.1 (and likely 8.0) we run into a couple of PHP warnings:

Warning: Undefined array key "id" in /code/docroot/modules/contrib/newrelic_transactions/src/EventSubscriber/EventSubscriber.php on line 129

Warning: Undefined array key "roles" in /code/docroot/modules/contrib/newrelic_transactions/src/EventSubscriber/EventSubscriber.php on line 132

In retrospect these may just be because the config form has never been saved, but once I get past these errors. I encounter a WSOD:

The website encountered an unexpected error. Please try again later.
TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, int given in method_exists() (line 77 of modules/contrib/newrelic_transactions/src/EventSubscriber/EventSubscriber.php).
method_exists(0, 'bundle') (Line: 77)
Drupal\newrelic_transactions\EventSubscriber\EventSubscriber->nameTransaction(Object, 'kernel.request', Object)
call_user_func(Array, Object, 'kernel.request', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.request') (Line: 145)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 718)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡―πŸ‡΅Japan ultrabob Japan

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

Comments & Activities

Production build 0.71.5 2024