Fix deprecated use of dispatch event

Created on 6 January 2023, over 1 year ago
Updated 19 January 2023, over 1 year 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 over 1 year ago
Production build 0.71.5 2024