Drupal 10.2
PHP 8.2

Deprecated function: Creation of dynamic property Drupal\symfony_mailer\Email::$_symfony_mailer_log is deprecated in Drupal\symfony_mailer_log\Plugin\EmailAdjuster\LogMail->postRender() (line 92 of modules/contrib/symfony_mailer_log/src/Plugin/EmailAdjuster/LogMail.php).

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jcontreras created an issue. See original summary.

abhishek_gupta1’s picture

Assigned: Unassigned » abhishek_gupta1
abhishek_gupta1’s picture

Assigned: abhishek_gupta1 » Unassigned
Status: Active » Needs review
StatusFileSize
new1015 bytes

@jcontreras, fixed the issue and created Patch. please kindly review it.

jrochate’s picture

When I added this patch, I got another error and now it's fatal:

TypeError: Drupal\symfony_mailer_log\Plugin\EmailAdjuster\LogMail::Drupal\symfony_mailer_log\Plugin\EmailAdjuster\{closure}(): Argument #1 ($address) must be of type Drupal\symfony_mailer_log\Plugin\EmailAdjuster\AddressInterface, Drupal\symfony_mailer\Address given em Drupal\symfony_mailer_log\Plugin\EmailAdjuster\LogMail->Drupal\symfony_mailer_log\Plugin\EmailAdjuster\{closure}() (linha 124 de /var/www/(...)/web/modules/contrib/symfony_mailer_log/src/Plugin/EmailAdjuster/LogMail.php).

jrochate’s picture

StatusFileSize
new509 bytes

Now it works.

svendecabooter’s picture

The attached patch fixes an issue with the call to getLogger() - so I have committed it.
However, the original issue reported here is the fact that we set a dynamic property:
$email->_symfony_mailer_log = $log;
This has not been resolved yet.

svendecabooter’s picture

Status: Needs review » Needs work

justafish made their first commit to this issue’s fork.

justafish’s picture

Status: Needs work » Needs review

Created an MR to fix the issue with the dynamic property - the LogMail object doesn't seem to get re-used when I stepped through it, so I stored the log object directly there, but maybe someone knows why that might be a bad idea 😅

sander wemagine’s picture

StatusFileSize
new591 bytes

I've added a patch that removes the error for us. Hopefully it can help someone else as well (until the repo is updated)

svendecabooter’s picture

Status: Needs review » Fixed
svendecabooter’s picture

Thanks justafish, that seems like the correct approach.
I have merged the MR now.

Status: Fixed » Closed (fixed)

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