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

Mautic users with same first/last name but different everything else causing API failures #13586

Open
1 task done
michael-ferioli opened this issue Mar 27, 2024 · 1 comment
Labels
bug Issues or PR's relating to bugs pending-feedback PR's and issues that are awaiting feedback from the author

Comments

@michael-ferioli
Copy link

michael-ferioli commented Mar 27, 2024

Mautic Version

4.4.x series

Way of installing

I downloaded a release from https://www.mautic.org/mautic-releases

PHP version

8.0.30

What browsers are you seeing the problem on?

Chrome

What happened?

If there are multiple users with the same first and last names but all other attributes are different (including email, username, etc.) then API calls that include a User ID will fail with a 400 error. Changing the last name on one of the users fixed the problem.

In the following example, we had user 200 and user 28 each with the same first/last name but other attributes were different.

We made a call to /contacts/:id/edit with owner_id=200 and we got a 400 error with this response:

{ "errors": [ { "code": 400, "message": "owner: This value is not valid.", "details": { "owner": [ "This value is not valid." ] } } ] }

image

How can we reproduce this issue?

  1. Create two Mautic users with the same first/last name but all other attributes different.
  2. Create a contact with no owner in the UI.
  3. Use Postman to update the owner_id using the PATCH /contacts/:id/edit endpoint and owner_id set to either of the users you setup in step 1 above.
  4. Notice that you get a 400 response.
  5. Change the last name of either of the users from step Emails triggering 500 server errors #1.
  6. Repeat step 'Apply' in configuration settings #3.
  7. Notice that it works this time.

Relevant log output

No response

Code of Conduct

  • I confirm that I have read and agree to follow this project's Code of Conduct




Care about this issue? Want to get it resolved sooner? If you are a member of Mautic, you can add some funds to the Bounties Project so that the person who completes this task can claim those funds once it is merged by a member of the core team! Read the docs here.

@michael-ferioli michael-ferioli added bug Issues or PR's relating to bugs needs-triage For new issues/PRs that need to be triaged labels Mar 27, 2024
@escopecz
Copy link
Sponsor Member

How did you define the owner in your request? By ID or first and last name?

@escopecz escopecz added pending-feedback PR's and issues that are awaiting feedback from the author and removed needs-triage For new issues/PRs that need to be triaged labels Apr 12, 2024
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 pending-feedback PR's and issues that are awaiting feedback from the author
Projects
None yet
Development

No branches or pull requests

2 participants