Repository navigation
Conversation
|
🤖 Thank you for contributing to CiviCRM! ❤️ We will need to test and review this PR. 👷 Introduction for new contributors...
PR commands & links...
|
Member
Author
|
test build will fail until the patch is published : |
Member
|
@monishdeb please also send a PR upstream to https://github.com/pear/Mail_Mime |
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes :
TypeError: array_merge(): Argument #1 must be of type array, null given
Origin: tests/phpunit/CRM/Activity/BAO/ActivityTest.php:1707
Origin: tests/phpunit/CRM/Activity/BAO/ActivityTest.php:1707
CRM_Activity_BAO_ActivityTest::testSendEmailWillReplaceTokensUniquelyForEachContact3
Failed asserting that 1 is identical to 2.
Origin: CRM/Activity/BAO/ActivityTest.php:1760
Before
This test sends one email to three contacts via
CRM_Utils_Mail::send($mailParams)with attachment. During this it calls pear/mail_mime while building attachment. In that library, PHP 8.6 deprecates calling is_a() with a string first argument. And these deprecations are treated as exception. Then CRM_Utils_Mail::send catches that exception and return FALSE here. Hence the target contact don't get created here as it doesn't reach this point. This eventually fails at tests/phpunit/CRM/Activity/BAO/ActivityTest.php:1707After
Replaced all
is_a()in pear/mail_mime toinstanceofand one place in core. This fixes all deprecation notices and clears the path for the unit-test.Technical Details
The latest state of https://github.com/pear/Mail_Mime has partially fixed 8.6 deprecation notice - commit. So I thought its better to patch the pear/mail_mime . But as I don't have enough privilege to publish the patch file. I followed the doc here to generate the patch. If this PR is approved please publish https://download.civicrm.org/patches/9c5ac4dfb7575adf131e7ee023aa2bb1b730b85b48133d96111e8ca4914af48e/php-86-is-a.patch
Comments
ping @colemanw @seamuslee001 @JoeMurray