Skip to content

Commit a294238

Browse files
committed
Merge remote-tracking branch 'karyna/fix-missing-name-in-layout' into ph-delivery
2 parents f0ec09b + 5af06d7 commit a294238

File tree

3 files changed

+26
-16
lines changed

3 files changed

+26
-16
lines changed

app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab/Conditions.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
*/
66
namespace Magento\CatalogRule\Block\Adminhtml\Promo\Catalog\Edit\Tab;
77

8-
use Magento\Backend\Block\Widget\Form;
98
use Magento\Backend\Block\Widget\Form\Generic;
9+
use Magento\Backend\Block\Widget\Form\Renderer\Fieldset;
1010
use Magento\Ui\Component\Layout\Tabs\TabInterface;
1111
use Magento\Rule\Model\Condition\AbstractCondition;
1212

1313
class Conditions extends Generic implements TabInterface
1414
{
1515
/**
16-
* @var \Magento\Backend\Block\Widget\Form\Renderer\Fieldset
16+
* @var Fieldset
1717
*/
1818
protected $_rendererFieldset;
1919

@@ -27,15 +27,15 @@ class Conditions extends Generic implements TabInterface
2727
* @param \Magento\Framework\Registry $registry
2828
* @param \Magento\Framework\Data\FormFactory $formFactory
2929
* @param \Magento\Rule\Block\Conditions $conditions
30-
* @param \Magento\Backend\Block\Widget\Form\Renderer\Fieldset $rendererFieldset
30+
* @param Fieldset $rendererFieldset
3131
* @param array $data
3232
*/
3333
public function __construct(
3434
\Magento\Backend\Block\Template\Context $context,
3535
\Magento\Framework\Registry $registry,
3636
\Magento\Framework\Data\FormFactory $formFactory,
3737
\Magento\Rule\Block\Conditions $conditions,
38-
\Magento\Backend\Block\Widget\Form\Renderer\Fieldset $rendererFieldset,
38+
Fieldset $rendererFieldset,
3939
array $data = []
4040
) {
4141
$this->_rendererFieldset = $rendererFieldset;
@@ -121,7 +121,7 @@ public function isAjaxLoaded()
121121
}
122122

123123
/**
124-
* @return Form
124+
* @inheritdoc
125125
*/
126126
protected function _prepareForm()
127127
{
@@ -135,6 +135,8 @@ protected function _prepareForm()
135135
}
136136

137137
/**
138+
* Adds 'Conditions' to the form.
139+
*
138140
* @param \Magento\CatalogRule\Api\Data\RuleInterface $model
139141
* @param string $fieldsetId
140142
* @param string $formName
@@ -154,7 +156,8 @@ protected function addTabToForm($model, $fieldsetId = 'conditions_fieldset', $fo
154156
['form_namespace' => $formName]
155157
);
156158

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')
158161
->setNewChildUrl($newChildUrl)
159162
->setFieldSetId($conditionsFieldSetId);
160163

@@ -183,6 +186,8 @@ protected function addTabToForm($model, $fieldsetId = 'conditions_fieldset', $fo
183186
}
184187

185188
/**
189+
* Sets form name for Condition section.
190+
*
186191
* @param AbstractCondition $conditions
187192
* @param string $formName
188193
* @param string $jsFormName

app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Actions.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
namespace Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab;
77

8+
use Magento\Backend\Block\Widget\Form\Renderer\Fieldset;
89
use Magento\Framework\App\ObjectManager;
910

1011
class Actions extends \Magento\Backend\Block\Widget\Form\Generic implements
@@ -69,55 +70,55 @@ public function __construct(
6970
}
7071

7172
/**
72-
* {@inheritdoc}
73+
* @inheritdoc
7374
*/
7475
public function getTabClass()
7576
{
7677
return null;
7778
}
7879

7980
/**
80-
* {@inheritdoc}
81+
* @inheritdoc
8182
*/
8283
public function getTabUrl()
8384
{
8485
return null;
8586
}
8687

8788
/**
88-
* {@inheritdoc}
89+
* @inheritdoc
8990
*/
9091
public function isAjaxLoaded()
9192
{
9293
return false;
9394
}
9495

9596
/**
96-
* {@inheritdoc}
97+
* @inheritdoc
9798
*/
9899
public function getTabLabel()
99100
{
100101
return __('Actions');
101102
}
102103

103104
/**
104-
* {@inheritdoc}
105+
* @inheritdoc
105106
*/
106107
public function getTabTitle()
107108
{
108109
return __('Actions');
109110
}
110111

111112
/**
112-
* {@inheritdoc}
113+
* @inheritdoc
113114
*/
114115
public function canShowTab()
115116
{
116117
return true;
117118
}
118119

119120
/**
120-
* {@inheritdoc}
121+
* @inheritdoc
121122
*/
122123
public function isHidden()
123124
{
@@ -165,7 +166,9 @@ protected function addTabToForm($model, $fieldsetId = 'actions_fieldset', $formN
165166
/** @var \Magento\Framework\Data\Form $form */
166167
$form = $this->_formFactory->create();
167168
$form->setHtmlIdPrefix('rule_');
168-
$renderer = $this->_rendererFieldset->setTemplate(
169+
170+
$renderer = $this->getLayout()->createBlock(Fieldset::class);
171+
$renderer->setTemplate(
169172
'Magento_CatalogRule::promo/fieldset.phtml'
170173
)->setNewChildUrl(
171174
$newChildUrl

app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Conditions.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
namespace Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab;
99

1010
use Magento\Framework\App\ObjectManager;
11-
use Magento\Framework\Data\Form\Element\Fieldset;
11+
use Magento\Backend\Block\Widget\Form\Renderer\Fieldset;
1212
use Magento\SalesRule\Model\Rule;
1313

1414
/**
@@ -163,7 +163,9 @@ protected function addTabToForm($model, $fieldsetId = 'conditions_fieldset', $fo
163163
/** @var \Magento\Framework\Data\Form $form */
164164
$form = $this->_formFactory->create();
165165
$form->setHtmlIdPrefix('rule_');
166-
$renderer = $this->_rendererFieldset->setTemplate(
166+
167+
$renderer = $this->getLayout()->createBlock(Fieldset::class);
168+
$renderer->setTemplate(
167169
'Magento_CatalogRule::promo/fieldset.phtml'
168170
)->setNewChildUrl(
169171
$newChildUrl

0 commit comments

Comments
 (0)