Skip to content

Not relevant logic in \Magento\Ui\Component\MassAction\Filter #10988

@naydav

Description

@naydav

Preconditions

  • Magento ver. 2.3.0-dev

Steps to reproduce

\Magento\Ui\Component\MassAction\Filter::getCollection
The main goal of this class is obtaining entity ids from request for mass actions

Expected result

  • Contract without dependency on AbstractDb $collection
  • Logic based on extra query is removed

Actual result

  • Parameter is AbstractDb $collection. But it is a redundant dependency. We need to provide ids, and for this action collection is not required.
    Also, it is violation of SPR, LSP principles, and CQS
  • In this way we have a double loading of the same date (entities ids). After performing
    {code}$idsArray = $this->getFilterIds();{code} we already have entity ids (obtained from data provider). But we apply a new filter to a collection based on these ids. So we need to do one more query which is reloading existing data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions