$ phpcs --standard=PHPCompatibility --runtime-set testVersion 7.3 --extensions=php,module,inc,install,test,profile,theme /sites/all/modules/contrib/htmlmail/

FILE: \sites\all\modules\contrib\htmlmail\htmlmail.mail.inc

321 | WARNING | Since PHP 7.0, functions inspecting arguments, like debug_backtrace(), no longer report the original value as passed to a parameter, but will instead provide the current
| | value. The parameter "$original_message" was used, and possibly changed (by reference), on line 238.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Issue fork htmlmail-3138522

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

ravikk-drupal created an issue. See original summary.

ravikk-drupal’s picture

Assigned: ravikk-drupal » Unassigned
Status: Active » Needs review
StatusFileSize
new856 bytes

This patch #2 work for me

minakshiPh’s picture

Status: Needs review » Reviewed & tested by the community

Hi @ravikk-drupal,

The patch in #2 removes the php compatibility warning. PFB screenshot for more details

/xampp/htdocs/drupal7/sites/all/modules/contrib/htmlmail
$ phpcs -p --standard=PHPCompatibility --extensions=php,inc --runtime-set testVersion 7.3 .
....W. 6 / 6 (100%)



\xampp\htdocs\drupal7\sites\all\modules\contrib\htmlmail\htmlmail.mail.inc
-------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------
 321 | WARNING | Since PHP 7.0, functions inspecting arguments, like debug_backtrace(), no longer report the original value as passed to a parameter, but
     |         | will instead provide the current value. The parameter "$original_message" was used, and possibly changed (by reference), on line 238.
-------------------------------------------------------------------------------------------------------------------------------------------------------------

Time: 2.82 secs; Memory: 12MB


/xampp/htdocs/drupal7/sites/all/modules/contrib/htmlmail
$ git apply --check htmlmail-PHPCompatibility-3138522-2.patch

/xampp/htdocs/drupal7/sites/all/modules/contrib/htmlmail
$ git apply -v htmlmail-PHPCompatibility-3138522-2.patch
Checking patch htmlmail.mail.inc...
Hunk #2 succeeded at 319 (offset -1 lines).
Applied patch htmlmail.mail.inc cleanly.

/xampp/htdocs/drupal7/sites/all/modules/contrib/htmlmail
$ phpcs -p --standard=PHPCompatibility --extensions=php,inc --runtime-set testVersion 7.3 .
....W. 6 / 6 (100%)


Time: 2.85 secs; Memory: 12MB


/xampp/htdocs/drupal7/sites/all/modules/contrib/htmlmail

+RTBC

Thanks,
minakshiPh

salvis’s picture

Version: 7.x-2.71 » 7.x-2.x-dev
salvis’s picture

Status: Reviewed & tested by the community » Needs work
spokje’s picture

StatusFileSize
new843 bytes

Re-roll against latest 7.x-2.x-dev

spokje’s picture

StatusFileSize
new846 bytes

Grmbl, spaces instead of tab this time...

spokje’s picture

Status: Needs work » Needs review

  • salvis committed e21f912 on 7.x-2.x
    Issue #3138522 by ravikk-drupal, Spokje: WARNING | Since PHP 7.0,...
salvis’s picture

Thank you ravikk-drupal, minakshiPh, and Spokje!

salvis’s picture

Status: Needs review » Fixed
tr’s picture

So wait - now a complete backtrace is being generated for EVERY email, not just when in debug mode? That can't be good for memory usage or processing time ...

tr’s picture

Status: Fixed » Active
Issue tags: -Html Mail, -PHP 7.3, -PHP compatibility +PHP 7.0 (duplicate)

Reopening because I don't think this is the correct fix.

tr’s picture

See #3167046: PHP 7 compatibility fixes for 8.x where we're discussing/fixing this for D8. I will backport the fix in that issue to D7.

salvis’s picture

I agree completely, my bad...

Thanks for cleaning this up in D8!

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

bzaher’s picture

Status: Active » Needs review

In MR !1 I removed the early debug_backtrace and backported most of what's in the D8 patch. I kept in the safe_mode section, since Drupal 7 technically still supports PHP 5.3.

astonvictor’s picture

StatusFileSize
new914 bytes
fenstrat’s picture

StatusFileSize
new1.31 KB

Here's a patch version of the MR in #17.

The patch in #19 doesn't remove the original debug_backtrace() call.

  • bzaher authored f8d95875 on 7.x-2.x
    Issue #3138522 by Spokje, ravikk-drupal, salvis: WARNING | Since PHP 7.0...
joseph.olstad’s picture

Status: Needs review » Fixed

Great thanks to my friend @bzaher for this fix!

Status: Fixed » Closed (fixed)

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