- 🇺🇸United States mglaman WI, USAMigrating some credit over from 🐛 EntityResourceBase::createCollectionDataFromEntities collapses results by $entity->id() Needs review Although #3204303-3: EntityResourceBase::createCollectionDataFromEntities collapses results by $entity->id() → points out a possible problem: I realize now that my proposed solution results in an invalid JSON:API schema; because translated entities share the same uuid as their default entity. And being that JSON:API result node ids (uuids) must be unique; this result is invalid. I still believe the collapsed response is unexpected. If I request 50 items, I should receive 50 valid items (when available). I think at minimum EntityResourceBase should log a message when the unique result set does not match the given set. 
- Status changed to Postponedover 1 year ago 12:32pm 3 April 2024
- 🇺🇸United States mglaman WI, USAI think the bug is really in jsonapi_search_api and its counts. \Drupal\jsonapi_resources\Resource\EntityResourceBase::createCollectionDataFromEntitiesis using\Drupal\jsonapi\Access\EntityAccessChecker::getAccessCheckedResourceObjectand ensures the translated entity is loaded via\Drupal\Core\Entity\EntityRepositoryInterface::getTranslationFromContext.This ties into #3120437: Add optional Count data. → . I think jsonapi_search_api needs the proper fix, and it looks like this issue is the best match 🐛 Multilingual Search shows wrong results number (especially with blank query) Active Postponing this instead of marking as a duplicate.