5
5
*/
6
6
namespace Magento \CatalogRule \Block \Adminhtml \Promo \Catalog \Edit \Tab ;
7
7
8
- use Magento \Backend \Block \Widget \Form ;
9
8
use Magento \Backend \Block \Widget \Form \Generic ;
9
+ use Magento \Backend \Block \Widget \Form \Renderer \Fieldset ;
10
10
use Magento \Ui \Component \Layout \Tabs \TabInterface ;
11
11
use Magento \Rule \Model \Condition \AbstractCondition ;
12
12
13
13
class Conditions extends Generic implements TabInterface
14
14
{
15
15
/**
16
- * @var \Magento\Backend\Block\Widget\Form\Renderer\ Fieldset
16
+ * @var Fieldset
17
17
*/
18
18
protected $ _rendererFieldset ;
19
19
@@ -27,15 +27,15 @@ class Conditions extends Generic implements TabInterface
27
27
* @param \Magento\Framework\Registry $registry
28
28
* @param \Magento\Framework\Data\FormFactory $formFactory
29
29
* @param \Magento\Rule\Block\Conditions $conditions
30
- * @param \Magento\Backend\Block\Widget\Form\Renderer\ Fieldset $rendererFieldset
30
+ * @param Fieldset $rendererFieldset
31
31
* @param array $data
32
32
*/
33
33
public function __construct (
34
34
\Magento \Backend \Block \Template \Context $ context ,
35
35
\Magento \Framework \Registry $ registry ,
36
36
\Magento \Framework \Data \FormFactory $ formFactory ,
37
37
\Magento \Rule \Block \Conditions $ conditions ,
38
- \ Magento \ Backend \ Block \ Widget \ Form \ Renderer \ Fieldset $ rendererFieldset ,
38
+ Fieldset $ rendererFieldset ,
39
39
array $ data = []
40
40
) {
41
41
$ this ->_rendererFieldset = $ rendererFieldset ;
@@ -121,7 +121,7 @@ public function isAjaxLoaded()
121
121
}
122
122
123
123
/**
124
- * @return Form
124
+ * @inheritdoc
125
125
*/
126
126
protected function _prepareForm ()
127
127
{
@@ -135,6 +135,8 @@ protected function _prepareForm()
135
135
}
136
136
137
137
/**
138
+ * Adds 'Conditions' to the form.
139
+ *
138
140
* @param \Magento\CatalogRule\Api\Data\RuleInterface $model
139
141
* @param string $fieldsetId
140
142
* @param string $formName
@@ -154,7 +156,8 @@ protected function addTabToForm($model, $fieldsetId = 'conditions_fieldset', $fo
154
156
['form_namespace ' => $ formName ]
155
157
);
156
158
157
- $ renderer = $ this ->_rendererFieldset ->setTemplate ('Magento_CatalogRule::promo/fieldset.phtml ' )
159
+ $ renderer = $ this ->getLayout ()->createBlock (Fieldset::class);
160
+ $ renderer ->setTemplate ('Magento_CatalogRule::promo/fieldset.phtml ' )
158
161
->setNewChildUrl ($ newChildUrl )
159
162
->setFieldSetId ($ conditionsFieldSetId );
160
163
@@ -183,6 +186,8 @@ protected function addTabToForm($model, $fieldsetId = 'conditions_fieldset', $fo
183
186
}
184
187
185
188
/**
189
+ * Sets form name for Condition section.
190
+ *
186
191
* @param AbstractCondition $conditions
187
192
* @param string $formName
188
193
* @param string $jsFormName
0 commit comments