Patch in comment #2 in https://www.drupal.org/project/mailmime/issues/2198587 seems to still not be present in the module. The patch in #4 is not advised since the create_function is deprecated in php 7.2

CommentFileSizeAuthor
#4 mailmime-php72-2997142.patch537 bytessalvis

Comments

mycw1991 created an issue. See original summary.

salvis’s picture

seems to still not be present in the module

The patch #4 is in the -dev version.

You're not really still using version 7.x-2.17, are you?

If you want to post a patch based on the -dev version (and change the Version indicator) to remove #4 and add #2 then I'll commit it, but I have severe doubts that this module can run under PHP 7 because AFAIK the dependencies don't.

ljgra’s picture

I am now using the dev version, but got the following error when trying to request for password change:

Deprecated function: Function create_function() is deprecated in MailMIME::toHeaders() (line 742 of .../sites/all/modules/mailmime/mailmime.inc).
Deprecated function: Function create_function() is deprecated in MailMIME::toHeaders() (line 742 of .../sites/all/modules/mailmime/mailmime.inc).
Deprecated function: Function create_function() is deprecated in MailMIME::toHeaders() (line 742 of .../sites/all/modules/mailmime/mailmime.inc).
Deprecated function: Function create_function() is deprecated in MailMIME::toHeaders() (line 742 of .../sites/all/modules/mailmime/mailmime.inc).
Deprecated function: Function create_function() is deprecated in MailMIME::toHeaders() (line 742 of .../sites/all/modules/mailmime/mailmime.inc).
Deprecated function: Function create_function() is deprecated in MailMIME::toHeaders() (line 742 of .../sites/all/modules/mailmime/mailmime.inc).
Deprecated function: Function create_function() is deprecated in MailMIME::toHeaders() (line 742 of .../sites/all/modules/mailmime/mailmime.inc).
Deprecated function: Function create_function() is deprecated in MailMIME::toHeaders() (line 742 of .../sites/all/modules/mailmime/mailmime.inc).
Deprecated function: Function create_function() is deprecated in MailMIME::toHeaders() (line 742 of .../sites/all/modules/mailmime/mailmime.inc).
Deprecated function: Function create_function() is deprecated in MailMIME::toHeaders() (line 742 of .../sites/all/modules/mailmime/mailmime.inc).
Deprecated function: Function create_function() is deprecated in MailMIME::toHeaders() (line 742 of .../sites/all/modules/mailmime/mailmime.inc).
Deprecated function: Function create_function() is deprecated in MailMIME::toHeaders() (line 742 of .../sites/all/modules/mailmime/mailmime.inc).
Deprecated function: Function create_function() is deprecated in MailMIME::toHeaders() (line 742 of .../sites/all/modules/mailmime/mailmime.inc).
Deprecated function: Function create_function() is deprecated in MailMIME::toHeaders() (line 742 of .../sites/all/modules/mailmime/mailmime.inc).

salvis’s picture

Version: 7.x-2.17 » 7.x-2.x-dev
Status: Active » Needs review
StatusFileSize
new537 bytes

Could this work?

Anonymous’s picture

Works for me!

avpaderno’s picture

Status: Needs review » Reviewed & tested by the community

Anonymous functions has been introduced in PHP 5.3. Since the minimum recommended PHP version for Drupal 7 is PHP 7.3, there should not be any issue with this change.

avpaderno’s picture

It seems I cannot push changes as the branch is protected. The error message says:

remote: GitLab: You are not allowed to push code to protected branches on this project.

  • salvis committed 7c93315 on 7.x-2.x
    Issue #2997142 by salvis: Replace create_function() with anonymous...
salvis’s picture

Status: Reviewed & tested by the community » Fixed

Thank for reviewing!

Status: Fixed » Closed (fixed)

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