Fix deprecated use of dispatch event

Created on 6 January 2023, almost 2 years ago
Updated 19 January 2023, almost 2 years ago

The arguments are called the wrong way around. This still works but is deprecated in Drupal 9.1.

In HostedFields::createPayment():

// Add metadata and extra transaction data where required.
$event = new TransactionDataEvent($transaction_data, $payment);
$this->eventDispatcher->dispatch(BraintreeEvents::TRANSACTION_DATA, $event);

Results in:
@trigger_error('Calling the Symfony\Component\EventDispatcher\EventDispatcherInterface::dispatch() method with a string event name as the first argument is deprecated in drupal:9.1.0, an Event object will be required instead in drupal:10.0.0. See https://www.drupal.org/node/3154407', E_USER_DEPRECATED);

🐛 Bug report
Status

Closed: duplicate

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom Rob230

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.

  • Status changed to Closed: duplicate almost 2 years ago
Production build 0.71.5 2024