Problems with resolveuid links generation in TinyMCE

I have a problem with internal links generated by Tiny in Plone5.

I have several results based on where i'm using Tiny.

Usually the url is created with something like this: href="../resolveuid/some_uid"
And in this case the traverser work fine and resolveuid works as expected.

But i have and edge-case with a page set as site's default view.
In the page's view i have an editable tile.
Clicking on button, a modal will be open with tile's edit form.

If i create an internal link from that modal, i have the following href value: site_id/resolveuid/some_uid.
With this value, resolveuid can't work because the final url will be: http://my-site-url/site_id/site_id/resolveuid/some_uid

I don't know the background of this choice, but why do we need to prepend something to resolveuid, if it works on the site root?
One simple solution could be fix this line and keep only "resolveuid/".

This will always generate "resolveuid/some_uid" href values in internal links and could fix my problems.

Are there some reasons that i don't know because we need to prepend something to resolveuid? If yes, is there a way to fix it for my use-case? I haven't found the place in the code where links are created with "../resolveuid" (or also with "../../../resolveuid") or with "site_id/".

It should not make a difference, as (due to acquisition) http://my-site-url and http://my-site-url/site_id usually lead to the same object (your site). This only will not work when your site contains an object whose id is the "site_id".

Therefore, I think that your problem really has a different cause: setting an object as the view of a folder introduces some ambiguity: in relative references do you mean the object or the folder as base. You see various places in the Plone UI, where it informs you about this potential ambiguity (and allows you to disambiguate). However, there are likely places (what one could call edge cases) where there is no warning and things behave unexpectedly.

Ok, i've found the reason why acquisition doesn't work in my case. I use experimental.noacquisition just to avoid cases where i have wrong urls that works only because acquisition.

I know that there is some ambiguity in setting a content as a default view, but imo internal url should be made always the same: resolveuid/some_uid.

I don't find a use-case where is useful to put something before resolveuid like the site id or "../", if i can call resolveuid on the root and avoid ambiguity problems like this.

Am i missing something maybe? I could patch this setting on my local installation, but if there aren't any side-effects, i could also fix it on CMFPlone.

1 Like