You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RESTApi currently assumes that all urls are on the same ___domain as the api endpoint and are treated as a local url if the url starts with the plone portal url. This applies to GET and POST. So if you have slate blocks with urls and save them, then these will only get turned into resolveUID links internally in the RESTAPI if the url matches the api url.
However Volto lets you have a different api url from the frontend url but it doesn't translate urls inside blocks into urls relative the portal root of the api url. Volto will pass the url as the full url based on the frontend url where the editing happens.
If you edit on a different url to the api url these links will be treated as external and the consequences are:
if the edit url is different to the frontend url the links will appear as the edit url and lead users to the wrong site
if the frontend url changes then the links will be broken
if the content moves then unneeded redirects will happen instead of direct links to the new ___location
deletion of linked content warnings won't occur
any other consequence of not having a resolveUID url.
To Reproduce
serve your frontend on two domains
make a slate link to another page
view this on the via the other ___domain
the url will take you to the edit ___domain
Expected behavior
This will be a local link
Volto should translate all urls to the api url before save. A reverse of the flattenToAppUrl translation.
Api.formatUrl(path) doesn't appear to be used anywhere currently to do this job
Other solutions considered
RESTApi should accept relative urls and Volto should use those instead.
RESTApi has a list of url prefixes it should treat as internal
Screenshots
If applicable, add screenshots to help explain your problem.
Software (please complete the following information):
OS: [e.g. iOS]
Browser [e.g. chrome, safari]
Volto Version [e.g. 8.5.0]
Plone Version [e.g. 5.2.2]
Plone REST API Version [e.g. 7.0.1]
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
RESTApi currently assumes that all urls are on the same ___domain as the api endpoint and are treated as a local url if the url starts with the plone portal url. This applies to GET and POST. So if you have slate blocks with urls and save them, then these will only get turned into resolveUID links internally in the RESTAPI if the url matches the api url.
However Volto lets you have a different api url from the frontend url but it doesn't translate urls inside blocks into urls relative the portal root of the api url. Volto will pass the url as the full url based on the frontend url where the editing happens.
If you edit on a different url to the api url these links will be treated as external and the consequences are:
To Reproduce
Expected behavior
This will be a local link
Volto should translate all urls to the api url before save. A reverse of the flattenToAppUrl translation.
Other solutions considered
Screenshots
If applicable, add screenshots to help explain your problem.
Software (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: