-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Open
Labels
Area: FrameworkComponent: AttributesIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.A defect with this priority could have functionality issues which are not to expectations.Reported on 2.4.6-p11Indicates original Magento version for the Issue report.Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchThe issue has been reproduced on latest 2.4-develop branchTriage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject itIssue related to Developer Experience and needs help with Triage to Confirm or Reject it
Description
Preconditions and environment
- 2.4.6-p11
- Magento 2 EE
Steps to reproduce
- Create a product collection using a productCollectionFactory
- Create Multiple Filters Using filterBuilder on different product attributes
- Create a filter group using a filterGroupBuilder and the previously created filters.
- Create a Search Criteria using SearchCriteriaBuilder with the previously created group of filters.
- Use the FilterProcessor Class and the process function to filter this collection using the search Criteria
- It will fail
{
$filters = [];
$data = "black"
$filters[] = $this->filterBuilder
->setField('description')
->setValue($data)
->setConditionType('eq')
->create();
$filters[] = $this->filterBuilder
->setField('color')
->setValue($data)
->setConditionType('eq')
->create();
$filters[] = $this->filterBuilder
->setField('country_of_manufacture')
->setValue($data)
->setConditionType('eq')
->create();
// Create a filter group with OR logic
$filterGroup = $this->filterGroupBuilder
->setFilters($filters)
->create();
// Build search criteria
$searchCriteria = $this->searchCriteriaBuilder
->setFilterGroups([$filterGroup])
->create();
$this->collection = $this->productCollectionFactory->create();
$this->collection->addAttributeToSelect('*');
// Apply the search criteria to the collection
$this->filterProcessor->process($searchCriteria, $this->collection);
$this->collection->load();
return $this->collection->getFirstItem();
}
Expected result
Get the products from the collection with the correct filters.
Actual result
Cannot access offset of type string on string at /var/www/src/vendor/magento/module-eav/Model/Entity/Collection/AbstractCollection.php:373
It seems that in the addAttributeToFilter function from module eav the condition parameter from the function is never used and actually replaced by the attribute array passed in the function.
Additional information
No response
Release note
No response
Triage and priority
- 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
Area: FrameworkComponent: AttributesIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.A defect with this priority could have functionality issues which are not to expectations.Reported on 2.4.6-p11Indicates original Magento version for the Issue report.Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchThe issue has been reproduced on latest 2.4-develop branchTriage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject itIssue related to Developer Experience and needs help with Triage to Confirm or Reject it
Type
Projects
Status
Ready for Development