Skip to content

Commit 113aa67

Browse files
committed
MC-15297: Selecting "Conditions Combination" For Product List Condition Will Throw 500 Error & Redirect User To Broken Page
Set value of $prefix in model's data registry to value of 'conditions'
1 parent d560bae commit 113aa67

File tree

1 file changed

+7
-1
lines changed
  • app/code/Magento/PageBuilder/Controller/Adminhtml/Form/Element/ProductConditions

1 file changed

+7
-1
lines changed

app/code/Magento/PageBuilder/Controller/Adminhtml/Form/Element/ProductConditions/Child.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,25 @@ public function execute()
4343

4444
$typeData = explode('|', str_replace('-', '/', $this->getRequest()->getParam('type')));
4545
$className = $typeData[0];
46+
$prefix = $this->getRequest()->getParam('prefix', 'conditions');
4647

4748
$model = $this->_objectManager->create($className)
4849
->setId($id)
4950
->setType($className)
5051
->setRule($this->rule)
51-
->setPrefix($this->getRequest()->getParam('prefix', 'conditions'));
52+
->setPrefix($prefix);
5253

5354
if (!empty($typeData[1])) {
5455
$model->setAttribute($typeData[1]);
5556
}
5657

5758
$result = '';
5859
if ($model instanceof AbstractCondition) {
60+
// set value of $prefix in model's data registry to value of 'conditions',
61+
// as is required for correct use of \Magento\Rule\Model\Condition\Combine::getConditions
62+
if ($model->getData($prefix) === null) {
63+
$model->setData($prefix, $model->getData('conditions'));
64+
}
5965
$model->setJsFormObject($jsObjectName);
6066
$model->setFormName($formName);
6167
$result = $model->asHtmlRecursive();

0 commit comments

Comments
 (0)