-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Area: FrameworkComponent: Framework/DataIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P3May be fixed according to the position in the backlog.May be fixed according to the position in the backlog.Progress: PR in progressProgress: doneReproduced 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 (*)
Magento 2.4.2
Steps to reproduce (*)
Call getItemsByColumnValue([string], [array])
on any collection.
Expected result (*)
Get the collection
Actual result (*)
Get null
.
Component: magento-framework
File: vendor/magento/framework/Data/Collection.php
Description
The problem is that the input parameter $value
has defined as an array
in the annotation.
If you are using an array with a single value, you will get back nothing and IDEs will mark it as an error.
You should use primitives (int, string, float, etc...).
The problem is that you defined the function like this:
/**
* @param string $column
* @param array $value
* @return array
*/
public function getItemsByColumnValue($column, $value)
but later you says:
if ($item->getData($column) == $value) {
So the value should be a primitive type, not an array.
Please fix it.
Issue: Confirmed
Metadata
Metadata
Assignees
Labels
Area: FrameworkComponent: Framework/DataIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P3May be fixed according to the position in the backlog.May be fixed according to the position in the backlog.Progress: PR in progressProgress: doneReproduced 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