Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #567 - Using iconv_mime_encode to fix email sending #568

Open
wants to merge 1 commit into
base: hotfix
Choose a base branch
from

Conversation

blummarci24
Copy link

@blummarci24 blummarci24 commented Nov 8, 2024

Description

This update addresses a critical bug in the Localization.php file within the translateCharsetMIME function, which was causing an error during email sending. The issue was linked to the use of mb_encode_mimeheader, which triggered a warning due to updates in the polyfill-mbstring dependency.

PHP Warning:  Undefined array key "from_addr_name" in /var/www/html/suitecrm/public/legacy/modules/Emails/EmailsController.php on line 265
PHP Warning:  Undefined array key "from_addr_name" in /var/www/html/suitecrm/public/legacy/modules/Emails/EmailsController.php on line 266
PHP Warning:  mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead in /var/www/html/suitecrm/vendor/symfony/polyfill-mbstring/Mbstring.php on line 152
PHP Fatal error:  Uncaught TypeError: mb_encode_mimeheader(): Return value must be of type string, null returned in /var/www/html/suitecrm/vendor/symfony/polyfill-mbstring/bootstrap80.php:21
Stack trace:
#0 /var/www/html/suitecrm/public/legacy/include/Localization/Localization.php(456): mb_encode_mimeheader

Motivation and Context

There is a failing code in the legacy Localization.php in translateCharsetMIME function causing error on email sending.

How To Test This

  1. Set up an new suitecrm environment (tested on 8.7 and php 8.2)
  2. Login and go to admin page
  3. Configure email and try to send a test email

Types of changes

  • [ x] Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Final checklist

  • [ x] My code follows the code style of this project found here.
  • My change requires a change to the documentation.
  • [x ] I have read the How to Contribute guidelines.

@SuiteBot
Copy link

SuiteBot commented Nov 8, 2024

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants