Skip to content

Conversation

patrykgruszka
Copy link
Member

@patrykgruszka patrykgruszka commented Apr 10, 2025

Q A
Bug fix? (use the a.b branch) ✔️
New feature/enhancement? (use the a.x branch)
Deprecations?
BC breaks? (use the c.x branch)
Automated tests included? ✔️
Related user documentation PR URL mautic/user-documentation#...
Related developer documentation PR URL mautic/developer-documentation-new#...
Issue(s) addressed Fixes #14456 https://forum.mautic.org/t/500-error-when-sending-test-email/35237

Description

This PR fixes the problem with submitting the sortable list when one of the elements are removed and the indexes and not sequential. This leads to errors like this #14456:

[2025-01-14T10:30:25.706423+00:00] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Mime\Exception\RfcComplianceException: "Email "1" does not comply with addr-spec of RFC 2822." at /home/www/mautic/www/vendor/symfony/mime/Address.php line 56 {"exception":"[object] (Symfony\\Component\\Mime\\Exception\\RfcComplianceException(code: 0): Email \"1\" does not comply with addr-spec of RFC 2822. at /home/www/mautic/www/vendor/symfony/mime/Address.php:56)"} {"hostname":"mautic.local","pid":5301}

📋 Steps to test this PR:

  1. Open this PR on Gitpod or pull down for testing locally (see docs on testing PRs here)
    Step 1: On 'Emails' page, select some email channel
    Step 2: Click the dropdown icon, and then select 'Send Example'
    Step 3: Remove existing recipient from 'Recipients' list
    Step 4: Click 'Add recipient'
    Step 5: On the new field, type desired email address
    Step 6: Click 'Send' button - the email should be sent successfully

Copy link

codecov bot commented Apr 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.67%. Comparing base (efb4bc6) to head (9b995cd).
Report is 5 commits behind head on 5.2.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##                5.2   #14866   +/-   ##
=========================================
  Coverage     63.66%   63.67%           
  Complexity    34662    34662           
=========================================
  Files          2273     2273           
  Lines        103705   103706    +1     
=========================================
+ Hits          66027    66030    +3     
+ Misses        37678    37676    -2     
Files with missing lines Coverage Δ
...e/Form/DataTransformer/SortableListTransformer.php 97.14% <100.00%> (+5.96%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mautibot
Copy link
Contributor

This pull request has been mentioned on Mautic Forums. There might be relevant details there:

https://forum.mautic.org/t/500-error-when-sending-test-email/35237/7

@matbcvo matbcvo added this to the 5.2.5 milestone Apr 10, 2025
@patrykgruszka patrykgruszka added T1 Low difficulty to fix (issue) or test (PR) bug Issues or PR's relating to bugs email Anything related to email ready-to-test PR's that are ready to test code-review-needed PR's that require a code review before merging labels Apr 10, 2025
@patrykgruszka patrykgruszka moved this to 🧑🏻‍💻 Needs a code review in Open Source Fridays Apr 11, 2025
@escopecz escopecz self-requested a review April 15, 2025 14:01
Copy link
Member

@escopecz escopecz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good. I was able to replicate the issue:

Screenshot 2025-04-15 at 16 01 50

And this PR fixes it. I was able to send the sample email with this code change 👍

@escopecz escopecz added code-review-passed PRs which have passed code review user-testing-passed PRs which have been successfully tested by the required number of people. and removed ready-to-test PR's that are ready to test code-review-needed PR's that require a code review before merging labels Apr 15, 2025
@escopecz escopecz merged commit 2067267 into mautic:5.2 Apr 15, 2025
17 checks passed
@github-project-automation github-project-automation bot moved this from 🧑🏻‍💻 Needs a code review to 🥳 Done in Open Source Fridays Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues or PR's relating to bugs code-review-passed PRs which have passed code review email Anything related to email T1 Low difficulty to fix (issue) or test (PR) user-testing-passed PRs which have been successfully tested by the required number of people.
Projects
Status: 🥳 Done
Development

Successfully merging this pull request may close these issues.

4 participants