"$this" can no longer be used in a plain function or method since PHP 7.1.

Created on 31 May 2019, about 5 years ago
Updated 1 April 2023, over 1 year ago

The module currently failed PHP7.2 test due to the $this in this .module file:

   if (!empty($mail)) {
      /* @var \Drupal\message_notify\MessageNotifier $message_notifier */
      $message_notifier = $this->container->get('message_notify.sender');
      // @todo - figure out how to pass the email addresses to the notify plugin / hook.
      $message_notifier->send($message, array('mail' => implode(',', $mail), 'email'));
    }

I think this can be fixed simply changing to call \Drupal::service('message_notify.sender') instead. Submitting a patch for this.

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇨🇦Canada richardmo

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.

Production build 0.69.0 2024