diff --git a/app/code/core/Mage/Rule/Model/Action/Abstract.php b/app/code/core/Mage/Rule/Model/Action/Abstract.php index 825105f2398..608e9f64f78 100644 --- a/app/code/core/Mage/Rule/Model/Action/Abstract.php +++ b/app/code/core/Mage/Rule/Model/Action/Abstract.php @@ -254,17 +254,19 @@ public function getTypeElement() */ public function getAttributeElement() { - $renderer = Mage::getBlockSingleton('rule/editable'); - if ($renderer instanceof Varien_Data_Form_Element_Renderer_Interface) { - $this->getForm()::setFieldsetRenderer($renderer); - } - - return $this->getForm()->addField('action:' . $this->getId() . ':attribute', 'select', [ + $element = $this->getForm()->addField('action:' . $this->getId() . ':attribute', 'select', [ 'name' => 'rule[actions][' . $this->getId() . '][attribute]', 'values' => $this->getAttributeSelectOptions(), 'value' => $this->getAttribute(), 'value_name' => $this->getAttributeName(), ]); + + $renderer = Mage::getBlockSingleton('rule/editable'); + if ($renderer instanceof Varien_Data_Form_Element_Renderer_Interface) { + $element->setRenderer($renderer); + } + + return $element; } /** @@ -272,17 +274,19 @@ public function getAttributeElement() */ public function getOperatorElement() { - $renderer = Mage::getBlockSingleton('rule/editable'); - if ($renderer instanceof Varien_Data_Form_Element_Renderer_Interface) { - $this->getForm()::setFieldsetRenderer($renderer); - } - - return $this->getForm()->addField('action:' . $this->getId() . ':operator', 'select', [ + $element = $this->getForm()->addField('action:' . $this->getId() . ':operator', 'select', [ 'name' => 'rule[actions][' . $this->getId() . '][operator]', 'values' => $this->getOperatorSelectOptions(), 'value' => $this->getOperator(), 'value_name' => $this->getOperatorName(), ]); + + $renderer = Mage::getBlockSingleton('rule/editable'); + if ($renderer instanceof Varien_Data_Form_Element_Renderer_Interface) { + $element->setRenderer($renderer); + } + + return $element; } /** @@ -290,16 +294,18 @@ public function getOperatorElement() */ public function getValueElement() { - $renderer = Mage::getBlockSingleton('rule/editable'); - if ($renderer instanceof Varien_Data_Form_Element_Renderer_Interface) { - $this->getForm()::setFieldsetRenderer($renderer); - } - - return $this->getForm()->addField('action:' . $this->getId() . ':value', 'text', [ + $element = $this->getForm()->addField('action:' . $this->getId() . ':value', 'text', [ 'name' => 'rule[actions][' . $this->getId() . '][value]', 'value' => $this->getValue(), 'value_name' => $this->getValueName(), ]); + + $renderer = Mage::getBlockSingleton('rule/editable'); + if ($renderer instanceof Varien_Data_Form_Element_Renderer_Interface) { + $element->setRenderer($renderer); + } + + return $element; } /** diff --git a/app/code/core/Mage/Rule/Model/Action/Collection.php b/app/code/core/Mage/Rule/Model/Action/Collection.php index b1415ecd24f..ce8ef27fe14 100644 --- a/app/code/core/Mage/Rule/Model/Action/Collection.php +++ b/app/code/core/Mage/Rule/Model/Action/Collection.php @@ -108,16 +108,18 @@ public function asHtml() */ public function getNewChildElement() { - $renderer = Mage::getBlockSingleton('rule/newchild'); - if ($renderer instanceof Varien_Data_Form_Element_Renderer_Interface) { - $this->getForm()::setFieldsetRenderer($renderer); - } - - return $this->getForm()->addField('action:' . $this->getId() . ':new_child', 'select', [ + $element = $this->getForm()->addField('action:' . $this->getId() . ':new_child', 'select', [ 'name' => 'rule[actions][' . $this->getId() . '][new_child]', 'values' => $this->getNewChildSelectOptions(), 'value_name' => $this->getNewChildName(), ]); + + $renderer = Mage::getBlockSingleton('rule/newchild'); + if ($renderer instanceof Varien_Data_Form_Element_Renderer_Interface) { + $element->setRenderer($renderer); + } + + return $element; } /** diff --git a/app/code/core/Mage/Rule/Model/Condition/Abstract.php b/app/code/core/Mage/Rule/Model/Condition/Abstract.php index 6971636b985..b55b4630693 100644 --- a/app/code/core/Mage/Rule/Model/Condition/Abstract.php +++ b/app/code/core/Mage/Rule/Model/Condition/Abstract.php @@ -509,17 +509,19 @@ public function getAttributeElement() } } - $renderer = Mage::getBlockSingleton('rule/editable'); - if ($renderer instanceof Varien_Data_Form_Element_Renderer_Interface) { - $this->getForm()::setFieldsetRenderer($renderer); - } - - return $this->getForm()->addField($this->getPrefix() . '__' . $this->getId() . '__attribute', 'select', [ + $element = $this->getForm()->addField($this->getPrefix() . '__' . $this->getId() . '__attribute', 'select', [ 'name' => 'rule[' . $this->getPrefix() . '][' . $this->getId() . '][attribute]', 'values' => $this->getAttributeSelectOptions(), 'value' => $this->getAttribute(), 'value_name' => $this->getAttributeName(), ]); + + $renderer = Mage::getBlockSingleton('rule/editable'); + if ($renderer instanceof Varien_Data_Form_Element_Renderer_Interface) { + $element->setRenderer($renderer); + } + + return $element; } /** diff --git a/app/code/core/Mage/Rule/Model/Condition/Combine.php b/app/code/core/Mage/Rule/Model/Condition/Combine.php index a462a0fc075..4b75d54ed91 100644 --- a/app/code/core/Mage/Rule/Model/Condition/Combine.php +++ b/app/code/core/Mage/Rule/Model/Condition/Combine.php @@ -147,17 +147,19 @@ public function getAggregatorElement() } } - $renderer = Mage::getBlockSingleton('rule/editable'); - if ($renderer instanceof Varien_Data_Form_Element_Renderer_Interface) { - $this->getForm()::setFieldsetRenderer($renderer); - } - - return $this->getForm()->addField($this->getPrefix() . '__' . $this->getId() . '__aggregator', 'select', [ + $element = $this->getForm()->addField($this->getPrefix() . '__' . $this->getId() . '__aggregator', 'select', [ 'name' => 'rule[' . $this->getPrefix() . '][' . $this->getId() . '][aggregator]', 'values' => $this->getAggregatorSelectOptions(), 'value' => $this->getAggregator(), 'value_name' => $this->getAggregatorName(), ]); + + $renderer = Mage::getBlockSingleton('rule/editable'); + if ($renderer instanceof Varien_Data_Form_Element_Renderer_Interface) { + $element->setRenderer($renderer); + } + + return $element; } /* end aggregator methods */ @@ -308,16 +310,18 @@ public function asHtml() */ public function getNewChildElement() { - $renderer = Mage::getBlockSingleton('rule/newchild'); - if ($renderer instanceof Varien_Data_Form_Element_Renderer_Interface) { - $this->getForm()::setFieldsetRenderer($renderer); - } - - return $this->getForm()->addField($this->getPrefix() . '__' . $this->getId() . '__new_child', 'select', [ + $element = $this->getForm()->addField($this->getPrefix() . '__' . $this->getId() . '__new_child', 'select', [ 'name' => 'rule[' . $this->getPrefix() . '][' . $this->getId() . '][new_child]', 'values' => $this->getNewChildSelectOptions(), 'value_name' => $this->getNewChildName(), ]); + + $renderer = Mage::getBlockSingleton('rule/newchild'); + if ($renderer instanceof Varien_Data_Form_Element_Renderer_Interface) { + $element->setRenderer($renderer); + } + + return $element; } /**