File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -162,7 +162,7 @@ protected function filterParams($data)
162
162
$ dateFilter = $ this ->_objectManager ->create (\Magento \Framework \Stdlib \DateTime \Filter \Date::class);
163
163
164
164
$ filterRules = [];
165
- foreach (['publish_time ' , 'custom_theme_from ' , 'custom_theme_to ' ] as $ dateField ) {
165
+ foreach (['publish_time ' , 'end_time ' , ' custom_theme_from ' , 'custom_theme_to ' ] as $ dateField ) {
166
166
if (!empty ($ data [$ dateField ])) {
167
167
$ filterRules [$ dateField ] = $ dateFilter ;
168
168
$ data [$ dateField ] = preg_replace ('/(.*)(\+\d\d\d\d\d\d)(\d\d)/U ' , '$1$3 ' , $ data [$ dateField ]);
Original file line number Diff line number Diff line change @@ -20,16 +20,24 @@ class View extends \Magefan\Blog\App\Action\Action
20
20
*/
21
21
protected $ _storeManager ;
22
22
23
+ /**
24
+ * @var \Magefan\Blog\Model\Url
25
+ */
26
+ protected $ url ;
27
+
23
28
/**
24
29
* @param \Magento\Framework\App\Action\Context $context
25
30
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
31
+ * @param \Magefan\Blog\Model\Url $url
26
32
*/
27
33
public function __construct (
28
34
\Magento \Framework \App \Action \Context $ context ,
29
- \Magento \Store \Model \StoreManagerInterface $ storeManager
35
+ \Magento \Store \Model \StoreManagerInterface $ storeManager ,
36
+ \Magefan \Blog \Model \Url $ url
30
37
) {
31
38
parent ::__construct ($ context );
32
39
$ this ->_storeManager = $ storeManager ;
40
+ $ this ->url = $ url ?: $ this ->_objectManager ->get (\Magefan \Blog \Model \Url::class);
33
41
}
34
42
35
43
/**
@@ -44,8 +52,12 @@ public function execute()
44
52
}
45
53
46
54
$ post = $ this ->_initPost ();
55
+
47
56
if (!$ post ) {
48
- return $ this ->_forwardNoroute ();
57
+ $ resultRedirect = $ this ->resultRedirectFactory ->create ();
58
+ $ resultRedirect ->setHttpResponseCode (301 );
59
+ $ resultRedirect ->setPath ($ this ->url ->getBaseUrl ());
60
+ return $ resultRedirect ;
49
61
}
50
62
51
63
$ this ->_objectManager ->get (\Magento \Framework \Registry::class)
You can’t perform that action at this time.
0 commit comments