Skip to content
Snippets Groups Projects
Commit 53920fae authored by rde's avatar rde Committed by Jeremy Kersten
Browse files

[FIX] website: key from page's view was not unique in every cases

Before this commit, if you created a page with the same name as another one
(which is allowed) it would set the same key for that second page.
Indeed, the code was setting correctly the path uniqueness but it was then
setting the key based on the name and not on the unique url we found free.

Now, the key is correctly uniquely set and even better, it is now completely
independant from the url and has its own 'find unique' method to be sure it is
correctly working.
It was not clever to have key & url being linked.

To be more clear:
1. Create page 'aboutus'
	key  is 'website.aboutus'
	name is 'aboutus'
	url  is '/aboutus'
2. Create page 'aboutus' ->
	key  is 'website.aboutus'
	name is 'aboutus'
	url  is '/aboutus-1'
Problem: key should be unique (for t-call for specific files & website_version)
Cause: key is set based on name which is not checking for uniqueness like url.
Two possible solutions:
	1. Set key based on url (which is being checked for uniqueness)
	2. Create & Use a specific method to get unique key
Fixed with solution 2 which is more clean.

--

It also fix an invisible 'bug':
Saving a page being in menu would cause the menu's URL to get it's trailing '/'
to be removed. It was only a problem when you were getting the warning about
dependencies (the menu wouldn't be recognized as dependencies because of the
removed '/')
parent 7692f52a
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment