magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.54k stars 9.32k forks source link

getItemsByColumnValue wrong type declaration #33070

Open vaso123 opened 3 years ago

vaso123 commented 3 years ago

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

m2-assistant[bot] commented 3 years ago

Hi @vaso123. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

m2-assistant[bot] commented 3 years ago

Hi @engcom-Golf. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

vaso123 commented 3 years ago

Please check it now.

magento-engcom-team commented 3 years ago

@engcom-Golf Thank you for verifying the issue.

Unfortunately, not enough information was provided to acknowledge ticket. Please consider adding the following:

Once all required information is added, please add label "Issue: Confirmed" again. Thanks!

magento-engcom-team commented 3 years ago

@m2-community-project[bot] Thank you for verifying the issue.

Unfortunately, not enough information was provided to acknowledge ticket. Please consider adding the following:

Once all required information is added, please add label "Issue: Confirmed" again. Thanks!

magento-engcom-team commented 3 years ago

@engcom-Golf Thank you for verifying the issue.

Unfortunately, not enough information was provided to acknowledge ticket. Please consider adding the following:

Once all required information is added, please add label "Issue: Confirmed" again. Thanks!

magento-engcom-team commented 3 years ago

@m2-community-project[bot] Thank you for verifying the issue.

Unfortunately, not enough information was provided to acknowledge ticket. Please consider adding the following:

Once all required information is added, please add label "Issue: Confirmed" again. Thanks!

magento-engcom-team commented 3 years ago

@engcom-Golf Thank you for verifying the issue.

Unfortunately, not enough information was provided to acknowledge ticket. Please consider adding the following:

Once all required information is added, please add label "Issue: Confirmed" again. Thanks!

magento-engcom-team commented 3 years ago

@m2-community-project[bot] Thank you for verifying the issue.

Unfortunately, not enough information was provided to acknowledge ticket. Please consider adding the following:

Once all required information is added, please add label "Issue: Confirmed" again. Thanks!

magento-engcom-team commented 3 years ago

:white_check_mark: Confirmed by @engcom-Golf Thank you for verifying the issue. Based on the provided information internal tickets MC-42509 were created

Issue Available: @engcom-Golf, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

yogesh-valiya commented 3 years ago

@magento I'm working on it

github-jira-sync-bot commented 2 weeks ago

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-13240 is successfully created for this GitHub issue.

m2-assistant[bot] commented 2 weeks ago

:white_check_mark: Confirmed by @engcom-Dash. Thank you for verifying the issue.
Issue Available: @engcom-Dash, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.