Skip to content

REST endpoint /customers/search not working for multi-store newsletter subscriptions #31168

Closed
@moiashvin

Description

@moiashvin

Preconditions (*)

  1. Magento version 2.4.1
  2. Magento 2.4-develop
  3. Admin -> Stores -> Configuration -> Customers -> Customer Configuration -> Account Sharing Options and set Share Customer Accounts to Global

Screenshot from 2020-12-07 12-59-48

  1. Multiple-store views setup in Magento

Screenshot from 2020-12-07 12-56-25

  1. Have one customer ( [email protected] for ex.);

Steps to reproduce (*)

  1. Go to Admin -> Customers -> All Customers and open customer for edit;
  2. On left side, select Newsletter, to have the Newsletter Informaiton panel where all stores views are displayed.
  3. Select more than 1 checkbox to subscriber customer to the store's newsletter and save customer
    (at this point, in Newsletter Subscribers view, customer is subscribed to newsletter for multiple-store views)

Screenshot from 2020-12-07 13-04-43

  1. Use REST to call GET /V1/customers/search to retrieve the customer

V1/customers/search?searchCriteria[filterGroups][0][filters][0][field]=email&searchCriteria[filterGroups][0][filters][0][value]=[email protected]&searchCriteria[filterGroups][0][filters][0][conditionType]=eq

Screenshot from 2020-12-07 13-06-15

Expected result (*)

  1. Customer details are returned correctly

Actual result (*)

  1. Exception occurs.
    {
    "message": "Internal Error. Details are available in Magento log file. Report ID: webapi-xxx"
    }

Screenshot from 2020-12-07 13-06-26

  1. And in the exception.log file:

[2020-12-07 10:36:54] main.CRITICAL: Report ID: webapi-5fce05c67a1e6; Message: Item (Magento\Customer\Model\Customer\Interceptor) with the same ID "1" already exists. {"exception":"[object] (Exception(code: 0): Report ID: webapi-5fce05c67a1e6; Message: Item (Magento\\Customer\\Model\\Customer\\Interceptor) with the same ID \"1\" already exists. at /var/www/html/magento24/lib/internal/Magento/Framework/Webapi/ErrorProcessor.php:208, Exception(code: 0): Item (Magento\\Customer\\Model\\Customer\\Interceptor) with the same ID \"1\" already exists. at /var/www/html/magento24/lib/internal/Magento/Framework/Data/Collection.php:408)"} []


Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • [x ] Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

Labels

Component: CustomerComponent: SearchFixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: ready for confirmationPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: doneReported on 2.4.1Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S2Major restrictions or short-term circumventions are required until a fix is available.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions