File tree Expand file tree Collapse file tree 8 files changed +17
-2
lines changed
Controller/Adminhtml/Index
Controller/Adminhtml/Index Expand file tree Collapse file tree 8 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,10 @@ public function execute()
37
37
/** @var \Magento\Backend\Model\View\Result\Page $resultPage */
38
38
$ resultPage = $ this ->resultPageFactory ->create ();
39
39
$ this ->initPage ($ resultPage )->getConfig ()->getTitle ()->prepend (__ ('Blocks ' ));
40
+
41
+ $ dataPersistor = $ this ->_objectManager ->get ('Magento\Framework\App\Request\DataPersistorInterface ' );
42
+ $ dataPersistor ->clear ('cms_block ' );
43
+
40
44
return $ resultPage ;
41
45
}
42
46
}
Original file line number Diff line number Diff line change @@ -49,6 +49,9 @@ public function execute()
49
49
$ resultPage ->addBreadcrumb (__ ('Manage Pages ' ), __ ('Manage Pages ' ));
50
50
$ resultPage ->getConfig ()->getTitle ()->prepend (__ ('Pages ' ));
51
51
52
+ $ dataPersistor = $ this ->_objectManager ->get ('Magento\Framework\App\Request\DataPersistorInterface ' );
53
+ $ dataPersistor ->clear ('cms_page ' );
54
+
52
55
return $ resultPage ;
53
56
}
54
57
}
Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ public function getData()
74
74
$ block = $ this ->collection ->getNewEmptyItem ();
75
75
$ block ->setData ($ data );
76
76
$ this ->loadedData [$ block ->getId ()] = $ block ->getData ();
77
+ $ this ->dataPersistor ->clear ('cms_block ' );
77
78
}
78
79
79
80
return $ this ->loadedData ;
Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ public function getData()
72
72
$ page = $ this ->collection ->getNewEmptyItem ();
73
73
$ page ->setData ($ data );
74
74
$ this ->loadedData [$ page ->getId ()] = $ page ->getData ();
75
+ $ this ->dataPersistor ->clear ('cms_page ' );
75
76
}
76
77
77
78
return $ this ->loadedData ;
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ public function execute()
33
33
$ resultPage ->addBreadcrumb (__ ('Manage Customers ' ), __ ('Manage Customers ' ));
34
34
35
35
$ this ->_getSession ()->unsCustomerData ();
36
+ $ this ->_getSession ()->unsCustomerFormData ();
36
37
37
38
return $ resultPage ;
38
39
}
Original file line number Diff line number Diff line change @@ -160,6 +160,7 @@ public function getData()
160
160
if (!empty ($ data )) {
161
161
$ customerId = isset ($ data ['customer ' ]['entity_id ' ]) ? $ data ['customer ' ]['entity_id ' ] : null ;
162
162
$ this ->loadedData [$ customerId ] = $ data ;
163
+ $ this ->getSession ()->unsCustomerFormData ();
163
164
}
164
165
165
166
return $ this ->loadedData ;
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ protected function setUp()
86
86
->getMock ();
87
87
$ this ->sessionMock = $ this ->getMockBuilder ('Magento\Backend\Model\Session ' )
88
88
->disableOriginalConstructor ()
89
- ->setMethods (['unsCustomerData ' ])
89
+ ->setMethods (['unsCustomerData ' , ' unsCustomerFormData ' ])
90
90
->getMock ();
91
91
92
92
$ objectManager = new \Magento \Framework \TestFramework \Unit \Helper \ObjectManager ($ this );
@@ -137,6 +137,8 @@ public function testExecute()
137
137
);
138
138
$ this ->sessionMock ->expects ($ this ->once ())
139
139
->method ('unsCustomerData ' );
140
+ $ this ->sessionMock ->expects ($ this ->once ())
141
+ ->method ('unsCustomerFormData ' );
140
142
141
143
$ this ->assertInstanceOf (
142
144
'Magento\Framework\View\Result\Page ' ,
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ protected function setUp()
67
67
->getMock ();
68
68
$ this ->sessionMock = $ this
69
69
->getMockBuilder ('Magento\Framework\Session\SessionManagerInterface ' )
70
- ->setMethods (['getCustomerFormData ' ])
70
+ ->setMethods (['getCustomerFormData ' , ' unsCustomerFormData ' ])
71
71
->getMockForAbstractClass ();
72
72
}
73
73
@@ -461,6 +461,8 @@ public function testGetDataWithCustomerFormData()
461
461
$ this ->sessionMock ->expects ($ this ->once ())
462
462
->method ('getCustomerFormData ' )
463
463
->willReturn ($ customerFormData );
464
+ $ this ->sessionMock ->expects ($ this ->once ())
465
+ ->method ('unsCustomerFormData ' );
464
466
465
467
$ this ->assertEquals ([$ customerId => $ customerFormData ], $ dataProvider ->getData ());
466
468
}
You can’t perform that action at this time.
0 commit comments