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)
99
99
if (!$ rewrite ) {
100
100
$ model ->getEntityType () === self ::ENTITY_TYPE_PRODUCT ? $ this ->checkProductCorrelation ($ model ) :
101
101
$ this ->checkCategoryCorrelation ($ model );
102
+ } else {
103
+ $ targetPath = $ rewrite ->getRequestPath ();
102
104
}
103
- $ targetPath = $ rewrite ->getRequestPath ();
104
105
}
105
106
return $ targetPath ;
106
107
}
@@ -114,7 +115,7 @@ protected function getTargetPath($model)
114
115
*/
115
116
private function checkCategoryCorrelation (\Magento \UrlRewrite \Model \UrlRewrite $ model ): void
116
117
{
117
- if (false === ( $ this -> _getCategory ()-> getStoreId () == $ model -> getStoreId ())) {
118
+ if (false === in_array ( $ model -> getStoreId (), $ this -> _getCategory ()-> getStoreIds ())) {
118
119
throw new LocalizedException (
119
120
__ ("The selected category isn't associated with the selected store. " )
120
121
);
You can’t perform that action at this time.
0 commit comments