-
Notifications
You must be signed in to change notification settings - Fork 9.4k
magento/magento2#28358: URL rewrites are not generated for categorie with 'Include in Menu=No' when creating a store view #30427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 2.4-develop
Are you sure you want to change the base?
Changes from 5 commits
44d1ebf
3403f39
660b0fb
1f6f3ff
bc28211
88c8aaa
5202a5b
c974fe5
37a60cb
be1b08c
fa6a920
b939410
e6f93dd
5f9c440
afc18a2
18e46f2
43d26e7
749ea9a
ffb4cee
a92024f
9f9470d
5800b49
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -170,6 +170,7 @@ public function getStoreId() | |
* @param array $exclude | ||
* @param boolean $toLoad | ||
* @param boolean $onlyActive | ||
* @param boolean $onlyIncludeInMenu | ||
* @return $this | ||
* @SuppressWarnings(PHPMD.CyclomaticComplexity) | ||
* @SuppressWarnings(PHPMD.NPathComplexity) | ||
|
@@ -179,7 +180,8 @@ public function addCollectionData( | |
$sorted = false, | ||
$exclude = [], | ||
$toLoad = true, | ||
$onlyActive = false | ||
$onlyActive = false, | ||
$onlyIncludeInMenu = false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changing an @api public method is BIC, please have a look at https://devdocs.magento.com/contributor-guide/backward-compatible-development/ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hi @gabrieldagama i have added code as BIC . Please review this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sodhisarab please, extract logic to the separate class |
||
) { | ||
if ($collection === null) { | ||
$collection = $this->getCollection($sorted); | ||
|
@@ -204,7 +206,10 @@ public function addCollectionData( | |
$collection->addFieldToFilter('entity_id', ['nin' => $disabledIds]); | ||
} | ||
$collection->addAttributeToFilter('is_active', 1); | ||
$collection->addAttributeToFilter('include_in_menu', 1); | ||
if($onlyIncludeInMenu){ | ||
$collection->addAttributeToFilter('include_in_menu', 1); | ||
} | ||
|
||
} | ||
|
||
if ($this->_joinUrlRewriteIntoCollection) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of change, this
getCategories
method wouldn't make more sense to look at the CatalogUrlRewrite plugins and use CategoryRepository there to fetch the required categories?