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)
162162 $ dateFilter = $ this ->_objectManager ->create (\Magento \Framework \Stdlib \DateTime \Filter \Date::class);
163163
164164 $ 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 ) {
166166 if (!empty ($ data [$ dateField ])) {
167167 $ filterRules [$ dateField ] = $ dateFilter ;
168168 $ 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
2020 */
2121 protected $ _storeManager ;
2222
23+ /**
24+ * @var \Magefan\Blog\Model\Url
25+ */
26+ protected $ url ;
27+
2328 /**
2429 * @param \Magento\Framework\App\Action\Context $context
2530 * @param \Magento\Store\Model\StoreManagerInterface $storeManager
31+ * @param \Magefan\Blog\Model\Url $url
2632 */
2733 public function __construct (
2834 \Magento \Framework \App \Action \Context $ context ,
29- \Magento \Store \Model \StoreManagerInterface $ storeManager
35+ \Magento \Store \Model \StoreManagerInterface $ storeManager ,
36+ \Magefan \Blog \Model \Url $ url
3037 ) {
3138 parent ::__construct ($ context );
3239 $ this ->_storeManager = $ storeManager ;
40+ $ this ->url = $ url ?: $ this ->_objectManager ->get (\Magefan \Blog \Model \Url::class);
3341 }
3442
3543 /**
@@ -44,8 +52,12 @@ public function execute()
4452 }
4553
4654 $ post = $ this ->_initPost ();
55+
4756 if (!$ post ) {
48- return $ this ->_forwardNoroute ();
57+ $ resultRedirect = $ this ->resultRedirectFactory ->create ();
58+ $ resultRedirect ->setHttpResponseCode (301 );
59+ $ resultRedirect ->setPath ($ this ->url ->getBaseUrl ());
60+ return $ resultRedirect ;
4961 }
5062
5163 $ this ->_objectManager ->get (\Magento \Framework \Registry::class)
You can’t perform that action at this time.
0 commit comments