Closed
Description
Preconditions
- Latest Magento 2.3
I spot the problem in M2 Commerce in RMA module, but as problem comes from M2 Open Source core and is clearly visible by code review, I'm adding it here.
Steps to reproduce
- Enable RMA feature in backend
- Place order in frontend
- Invoice and ship order in backend
- Navigate to order details in My Account pages in frontend
- Open order details
- Click "Return"
Expected result
RMA form is displayed
Actual result
Exception is thrown:
1 exception(s):
Exception #0 (Exception): Warning: Invalid argument supplied for foreach() in vendor/magento/module-rma/Block/Returns/Create.php on line 155
The problem looks as introduced in \Magento\Eav\Model\Form::getAttributes
where not all class variables are initialized as array, but they are returned by method which suppose to return array:
public function getSystemAttributes()
{
if ($this->_systemAttributes === null) {
// load attributes
$this->getAttributes();
}
return $this->_systemAttributes;
}
getAttributes
method initializes _attributes
and _userAttributes
variables as arrays but not _systemAttributes
and _allowedAttributes
.
I will submit PR for this soon.
Metadata
Metadata
Assignees
Labels
The issue has been fixed in 2.2 release lineThe issue has been fixed in 2.3 release lineGate 2 Passed. Manual verification of the issue description passedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 1 Passed. Automatic verification of issue format passedGate 4. Acknowledged. Issue is added to backlog and ready for developmentThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.3 release