After #411 we have the following situation now:
Same alias is prevented
- with same parent item
- or at root level ("same"
parent_nav_id = 0).
/* this is possible */ /* this is NOT possible */
Website1 Website1
├── alias_a ├── alias_a
│ ├── alias_b │ ├── alias_c
│ └── alias_c │ └── alias_c ↯
├── alias_b ├── alias_b
│ └── alias_c │ └── alias_c
└── alias_c └── alias_a ↯
That is the desired behavior.
But there is no support of multiple websites in verifyAlias().
The GROUP BY clause
|
->groupBy('cms_nav_container.website_id') |
doesn't reach it. In my opinion this clause can be omitted because of the presence of
->exists().
Currently, it's not possible to have two pages at root level with same alias but in different websites,
because of "same" parent_nav_id = 0.
/* this is currently NOT possible */
Website1
├── homepage
├── alias_a
│ └── alias_c
└── alias_b
Website2
├── homepage ↯
├── alias_c
│ └── alias_d
└── alias_b ↯
The WHERE clause
|
->where(['cms_nav_item.alias' => $alias, 'cms_nav_item.lang_id' => $langId, 'cms_nav.parent_nav_id' => $parentNavId]) |
should be something like
->where(['cms_nav_item.alias' => $alias, 'cms_nav_item.lang_id' => $langId, 'cms_nav.parent_nav_id' => $parentNavId, 'cms_nav_container.website_id' => $websiteId]) and
$websiteId must be provided in
verifyAlias().
After #411 we have the following situation now:
Same alias is prevented
parent_nav_id=0).That is the desired behavior.
But there is no support of multiple websites in
verifyAlias().The GROUP BY clause
luya-module-cms/src/models/NavItem.php
Line 270 in f779150
->exists().Currently, it's not possible to have two pages at root level with same alias but in different websites,
because of "same"
parent_nav_id=0.The WHERE clause
luya-module-cms/src/models/NavItem.php
Line 269 in f779150
->where(['cms_nav_item.alias' => $alias, 'cms_nav_item.lang_id' => $langId, 'cms_nav.parent_nav_id' => $parentNavId, 'cms_nav_container.website_id' => $websiteId])and$websiteIdmust be provided inverifyAlias().