File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
app/code/Magento/UrlRewrite/Controller/Adminhtml/Url/Rewrite Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -99,8 +99,9 @@ protected function getTargetPath($model)
9999 if (!$ rewrite ) {
100100 $ model ->getEntityType () === self ::ENTITY_TYPE_PRODUCT ? $ this ->checkProductCorrelation ($ model ) :
101101 $ this ->checkCategoryCorrelation ($ model );
102+ } else {
103+ $ targetPath = $ rewrite ->getRequestPath ();
102104 }
103- $ targetPath = $ rewrite ->getRequestPath ();
104105 }
105106 return $ targetPath ;
106107 }
@@ -114,7 +115,7 @@ protected function getTargetPath($model)
114115 */
115116 private function checkCategoryCorrelation (\Magento \UrlRewrite \Model \UrlRewrite $ model ): void
116117 {
117- if (false === ( $ this -> _getCategory ()-> getStoreId () == $ model -> getStoreId ())) {
118+ if (false === in_array ( $ model -> getStoreId (), $ this -> _getCategory ()-> getStoreIds ())) {
118119 throw new LocalizedException (
119120 __ ("The selected category isn't associated with the selected store. " )
120121 );
You can’t perform that action at this time.
0 commit comments