Skip to content
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

Pages with same alias #409

Closed
hbugdoll opened this issue Feb 19, 2024 · 3 comments · Fixed by #411
Closed

Pages with same alias #409

hbugdoll opened this issue Feb 19, 2024 · 3 comments · Fixed by #411
Assignees

Comments

@hbugdoll
Copy link
Member

What steps will reproduce the problem?

  1. Creat a page.
  2. Create another page with the same alias (= "URL Path segment") from 1.

What is the expected result?

  • An error like nav_item_model_error_urlsegementexistsalready is raised.

What do you get instead? (A Screenshot can help us a lot!)

  • Two pages with same alias, see in cms_nav_item:
+----+--------+---------+---------------+------------------+--------+--------+
| id | nav_id | lang_id | nav_item_type | nav_item_type_id | title  | alias  |
+----+--------+---------+---------------+------------------+--------+--------+
| 24 |     24 |       1 |             1 |               24 | A Page | a-page |
| 25 |     25 |       1 |             1 |               25 | A Page | a-page |
+----+--------+---------+---------------+------------------+--------+--------+

  • So Nav::moveToBefore() resp. Nav::moveToAfter() are failing when pages with same alias are invoked.

  • It seems that NavItem::validateAlias() isn't called before page creation.

Additional infos

Q A
LUYA Version Admin 5.0, CMS 5.0
PHP Version 8.2
Platform Apache
Operating system Linux Server
@nadar nadar self-assigned this Feb 21, 2024
@nadar
Copy link
Contributor

nadar commented Feb 21, 2024

The validation is called, but it looks like the exists query is not correctly https://github.com/luyadev/luya-module-cms/blob/master/src/models/NavItem.php#L263-L269 i will check this quickly

@hbugdoll
Copy link
Member Author

hbugdoll commented Feb 24, 2024

@nadar First of all, many thanks for your quick support!

@hbugdoll
Copy link
Member Author

hbugdoll commented Feb 24, 2024

Edit: Further discussion moved to new issue #413.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants