Skip to content

Conversation

1792826181
Copy link
Contributor

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 #14379

Description

When multiple objects share the same name in the multiselect fields only one of them would be displayed, making it difficult to select the correct object. This issue affected segments, campaigns, categories, and other entities, leading to user confusion and selection errors.

The problem was caused by the way object lists were indexed using names as keys, which led to duplicate entries being overwritten. To fix this, the logic was updated to append each object's unique ID in parentheses, ensuring clear differentiation. The changes were applied consistently across all affected areas and tests were created to verify that the objects are now properly distinguishable.


📋 Steps to test this PR:

  1. Go to Segments in the side menu and create two segments with the same name
  2. Go to Contacts in the side menu and if there is no contact than create one
  3. Mark the checkbox next to the contact
  4. Click the three dots in the table header
  5. Select Change Segments from the list
  6. See that the two segments are displayed in the format 'name (id)' when you click the search bar

Appends the object ID in brackets after the name to ensure clarity.
Applied changes across multiple areas: Segments, Campaigns and others.
Add new acceptance Test for Multiselect Field Fix.
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.

I have no suggestions here. Really nicely done, nice E2E tests added. 👍

Thank you!

@escopecz escopecz added bug Issues or PR's relating to bugs pending-test-confirmation PR's that require one test before they can be merged code-review-passed PRs which have passed code review labels Mar 25, 2025
Copy link

@imaabasiee imaabasiee left a comment

Choose a reason for hiding this comment

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

Looks good to me
Screenshot 2025-03-25 142026

Copy link
Contributor

@shinde-rahul shinde-rahul left a comment

Choose a reason for hiding this comment

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

This is awesome. The code changes look good to me.

@escopecz escopecz added user-testing-passed PRs which have been successfully tested by the required number of people. and removed pending-test-confirmation PR's that require one test before they can be merged labels Mar 25, 2025
@escopecz escopecz added this to the 5.2.5 milestone Mar 25, 2025
@escopecz escopecz merged commit 2a15421 into mautic:5.2 Mar 25, 2025
25 checks passed
@escopecz
Copy link
Member

@all-contributors please add @1792826181 for code

Copy link
Contributor

@escopecz

I've put up a pull request to add @1792826181! 🎉

@driskell
Copy link
Contributor

Just had a confusion on this when testing where someone thought the number was the number of contacts in a segment (we have fairly large ID in the hundreds).

I’ll see if any other reports but wanted to note as it could be worth having it say (ID: x) instead?

@escopecz
Copy link
Member

@driskell I like that! Just a number without any unit is confusing. But it's already in other places so we should change it at all places.

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 user-testing-passed PRs which have been successfully tested by the required number of people.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants