luyadev / luya-module-cms

The LUYA CMS module provides a full functional CMS for adding contents based on blocks.
https://luya.io
MIT License
33 stars 46 forks source link

Pages with same alias #409

Closed hbugdoll closed 8 months ago

hbugdoll commented 8 months ago

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?

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

+----+--------+---------+---------------+------------------+--------+--------+
| 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 |
+----+--------+---------+---------------+------------------+--------+--------+

Additional infos

Q A
LUYA Version Admin 5.0, CMS 5.0
PHP Version 8.2
Platform Apache
Operating system Linux Server
nadar commented 8 months ago

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 commented 8 months ago

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

hbugdoll commented 8 months ago

Edit: Further discussion moved to new issue https://github.com/luyadev/luya-module-cms/issues/413.