Ok, I wasn’t very clear on this, so I’ll explain with an exemple :
In my configuration, I set
Use Friendly URLs -> yes
Use Friendly Aliases -> yes
Cache is cleared.
Same structure as shown in my first message.
I start at the root page : site.com
If I click on Document2 in wayfinder, I am now in site.com/document2.html
Now, the link to Document1 is : document2.html (well, in fact, in source code, href is empty, so it links to itself - it is not Wayfinder related, as code [[~1]] returns nothing)
Link to other documents are normal, ie : document2.html, folder3/, folder3/document4.html...
I go to folder3 : I am now in site.com/folder3/ (and see my page), then if I click on Document2, I will go to site.com/folder3/document2.html, which doesn’t exist ; If I click on Document4 (under folder3), I will go to site.com/folder3/folder3/document4.html - an error too, and so on.
I works the same if I had gone to document4 directly.
I tried without friendly aliases just for comparison purpose, as you said, there is no point to it, but behaviour is a bit different :
Use Friendly URLs -> yes
Use Friendly Aliases -> no
Cache is cleared.
I start again at the root page : site.com
If I click on Document2 in wayfinder, I am now in site.com/2.html
href for the first document is still empty.
Link to other documents are : 2.html, 3/, 4.html... We see that now, links don’t take the folder into account.
I go to folder3 : I am now in site.com/3/ (and see my page), then if I click on Document2, I will go to site.com/3/2.html, which doesn’t exist ; If I click on Document4 (under folder3), I will go to site.com/3/4.html - note that it did not add another "3/" part, as links without aliases directly point to documents, even though it still points on a document that does not exist. But if I click again on Folder3, then I will go to site/com/3/3/, which of course doesn’t exist.
If I had gone to document4 directly I would be on site.com/4.html, which works...
Si as I understand it, there is a problem with friendly urls for the link to document ID 1 : [[~1]] and only this one, as for others id, it works fine.
there is also a problem with children documents and links that are relative to actual url, and not the root path of ModX.
I believe it is simply a small part of code to correct, but I have no idea where to look...
[EDIT] : behavior with Friendly Aliases but without "use friendly alias path" is the same as without Friendly Aliases.