-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Open
Labels
Issue: needs updateAdditional information is require, waiting for responseAdditional information is require, waiting for responseReported on 2.4.7Indicates original Magento version for the Issue report.Indicates original Magento version for the Issue report.Triage: 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
Summary
Preconditions:
- Magento Open Source 2.4.x (verified on 2.4.7 and 2.4-develop)
- Clean installation, no custom overrides required
Steps to Reproduce:
- Review
\Magento\Catalog\Model\CategorywheregetChildren()is called:
$this->getResource()->getChildren($this, $recursive, $isActive, $sortByPosition);
- Open
\Magento\Catalog\Model\ResourceModel\Categoryand observe the method signature:
public function getChildren($category, $recursive = true)
{
...
}
-
Notice that only 2 parameters are defined in the resource model, but 4 are being passed.
-
Generated interceptors include:
public function getChildren($category, $recursive = true)
{
$pluginInfo = $this->pluginList->getNext($this->subjectType, 'getChildren');
return $pluginInfo
? $this->___callPlugins('getChildren', func_get_args(), $pluginInfo)
: parent::getChildren($category, $recursive);
}
- Create a plugin for getChildren() that uses $proceed() — observe argument mismatches or confusion about expected parameters.
Expected Result:
Method signatures between model and resource model should align, or Documentation (PHPDoc / comment) should clarify that extra parameters are intentionally passed for backward compatibility.
Plugin developers should not face uncertainty about argument counts.
Actual Result:
- 4 parameters are passed while only 2 are defined.
- The interceptor passes all via func_get_args(), which can, confuse plugin developers, produce argument mismatches when $proceed() is used, /and reduce IDE/static analysis accuracy.
Examples
- Review
\Magento\Catalog\Model\CategorywheregetChildren()is called:
$this->getResource()->getChildren($this, $recursive, $isActive, $sortByPosition);
- Open
\Magento\Catalog\Model\ResourceModel\Categoryand observe the method signature:
public function getChildren($category, $recursive = true)
{
...
}
Proposed solution
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
Issue: needs updateAdditional information is require, waiting for responseAdditional information is require, waiting for responseReported on 2.4.7Indicates original Magento version for the Issue report.Indicates original Magento version for the Issue report.Triage: 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
Needs Update