File tree Expand file tree Collapse file tree 3 files changed +7
-8
lines changed
app/code/Magento/PageBuilder
Controller/Adminhtml/Template
Ui/Component/Listing/Columns
dev/tests/integration/testsuite/Magento/PageBuilder/Controller/Adminhtml/Template Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 10
10
11
11
use Magento \Backend \App \Action ;
12
12
use Magento \Backend \App \Action \Context ;
13
- use Magento \Framework \App \Action \HttpGetActionInterface ;
13
+ use Magento \Framework \App \Action \HttpPostActionInterface ;
14
14
use Magento \Framework \Exception \LocalizedException ;
15
15
use Magento \PageBuilder \Api \Data \TemplateInterface ;
16
16
use Magento \PageBuilder \Api \TemplateRepositoryInterface ;
20
20
/**
21
21
* Delete a template within template manager
22
22
*/
23
- class Delete extends Action implements HttpGetActionInterface
23
+ class Delete extends Action implements HttpPostActionInterface
24
24
{
25
25
const ADMIN_RESOURCE = 'Magento_PageBuilder::template_delete ' ;
26
26
Original file line number Diff line number Diff line change 8
8
9
9
namespace Magento \PageBuilder \Ui \Component \Listing \Columns ;
10
10
11
+ use Magento \Framework \AuthorizationInterface ;
11
12
use Magento \Framework \Escaper ;
12
13
use Magento \Framework \UrlInterface ;
13
14
use Magento \Framework \View \Element \UiComponent \ContextInterface ;
14
15
use Magento \Framework \View \Element \UiComponentFactory ;
15
- use Magento \Ui \Component \Listing \Columns \Column ;
16
- use Magento \Framework \AuthorizationInterface ;
17
16
use Magento \PageBuilder \Model \Stage \Config ;
17
+ use Magento \Ui \Component \Listing \Columns \Column ;
18
18
19
19
/**
20
20
* Provide actions to the action column in Templates grid
@@ -78,7 +78,6 @@ public function prepare()
78
78
*/
79
79
public function prepareDataSource (array $ dataSource )
80
80
{
81
-
82
81
if (isset ($ dataSource ['data ' ]['items ' ])) {
83
82
foreach ($ dataSource ['data ' ]['items ' ] as & $ item ) {
84
83
$ name = $ this ->getData ('name ' );
@@ -96,10 +95,10 @@ public function prepareDataSource(array $dataSource)
96
95
),
97
96
'confirm ' => [
98
97
'title ' => __ ('Delete %1? ' , $ templateName ),
99
- 'message ' =>
100
- __ ('Are you sure you want to permanently delete template %1? ' , $ templateName ),
98
+ 'message ' => __ ('Are you sure you want to permanently delete template %1? ' , $ templateName ),
101
99
'__disableTmpl ' => true ,
102
100
],
101
+ 'post ' => true ,
103
102
'__disableTmpl ' => true ,
104
103
];
105
104
}
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ public function testDeleteAction()
70
70
$ items = $ findTemplate ->getItems ();
71
71
$ templateId = reset ($ items )->getId ();
72
72
73
- $ this ->getRequest ()->setPostValue (['template_id ' => $ templateId ])->setMethod (HttpRequest::METHOD_GET );
73
+ $ this ->getRequest ()->setPostValue (['template_id ' => $ templateId ])->setMethod (HttpRequest::METHOD_POST );
74
74
$ this ->deleteController ->execute ();
75
75
76
76
$ this ->expectExceptionMessage ('Template with id " ' . $ templateId . '" does not exist. ' );
You can’t perform that action at this time.
0 commit comments