Skip to content

Commit 80b49cd

Browse files
authored
ENGCOM-5644: Resolve Wrong Label when create new "Attribute Set" (issue 24147) #24148
2 parents bbb22b3 + 4e68513 commit 80b49cd

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formset.php

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,17 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Catalog\Block\Adminhtml\Product\Attribute\Set\Main;
79

810
use Magento\Backend\Block\Widget\Form;
911

12+
/**
13+
* Form attribute set
14+
*
15+
* Class \Magento\Catalog\Block\Adminhtml\Product\Attribute\Set\Main\Formset
16+
*/
1017
class Formset extends \Magento\Backend\Block\Widget\Form\Generic
1118
{
1219
/**
@@ -43,7 +50,7 @@ protected function _prepareForm()
4350

4451
/** @var \Magento\Framework\Data\Form $form */
4552
$form = $this->_formFactory->create();
46-
$fieldset = $form->addFieldset('set_name', ['legend' => __('Edit Attribute Set Name')]);
53+
$fieldset = $form->addFieldset('set_name', ['legend' => $this->getAttributeSetLabel()]);
4754
$fieldset->addField(
4855
'attribute_set_name',
4956
'text',
@@ -84,4 +91,18 @@ protected function _prepareForm()
8491
$form->setOnsubmit('return false;');
8592
$this->setForm($form);
8693
}
94+
95+
/**
96+
* Get Attribute Set Label
97+
*
98+
* @return \Magento\Framework\Phrase
99+
*/
100+
private function getAttributeSetLabel()
101+
{
102+
if ($this->getRequest()->getParam('id', false)) {
103+
return __('Edit Attribute Set Name');
104+
}
105+
106+
return __('Attribute Set Information');
107+
}
87108
}

app/code/Magento/Catalog/i18n/en_US.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,3 +813,5 @@ Details,Details
813813
"Edit Category Design","Edit Category Design"
814814
"A total of %1 record(s) haven't been deleted. Please see server logs for more details.","A total of %1 record(s) haven't been deleted. Please see server logs for more details."
815815
"Are you sure you want to delete this category?","Are you sure you want to delete this category?"
816+
"Attribute Set Information","Attribute Set Information"
817+

0 commit comments

Comments
 (0)