Skip to content

Commit d328b4c

Browse files
author
roman
committed
MAGETWO-97066: Fixed incorrect behavior of catalog attributes actions
1 parent f084fb7 commit d328b4c

File tree

2 files changed

+19
-1
lines changed
  • app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute
  • dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product

2 files changed

+19
-1
lines changed

app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,24 @@ protected function _construct()
9191
if (!$entityAttribute || !$entityAttribute->getIsUserDefined()) {
9292
$this->buttonList->remove('delete');
9393
} else {
94-
$this->buttonList->update('delete', 'label', __('Delete Attribute'));
94+
$this->buttonList->update(
95+
'delete',
96+
'onclick',
97+
sprintf(
98+
"deleteConfirm('%s','%s', %s)",
99+
__('Are you sure you want to do this?'),
100+
$this->getDeleteUrl(),
101+
json_encode(
102+
[
103+
'action' => '',
104+
'data' => [
105+
'form_key' => $this->getFormKey()
106+
]
107+
]
108+
)
109+
)
110+
);
111+
95112
}
96113
}
97114

dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/AttributeTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
/**
1212
* @magentoAppArea adminhtml
1313
* @magentoDbIsolation enabled
14+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1415
*/
1516
class AttributeTest extends \Magento\TestFramework\TestCase\AbstractBackendController
1617
{

0 commit comments

Comments
 (0)