Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View template for Link renders resolveuid URL #575

Open
fulv opened this issue Dec 8, 2020 · 3 comments
Open

View template for Link renders resolveuid URL #575

fulv opened this issue Dec 8, 2020 · 3 comments

Comments

@fulv
Copy link
Member

fulv commented Dec 8, 2020

The LinkFieldWidget introduced in the Link content type to select a target object or URL is a nice usability addition (6daea2d5a and aea91f19a2).

However, the view template now renders a URL with a resolveuid/.....uid.... in it when the user selects an internal object as the target for remoteUrl.

This is ugly and does not convey the expected information to the editor user. As an editor, I want to see the path to the object in the URL, not a uid.

(I can hover the mouse on the link and see the actual path in the URL displayed by the browser, showing that the href attribute has the full path and not a resolveuid.)

@yurj
Copy link
Contributor

yurj commented Nov 15, 2021

meta code:

link_url = context.unrestrictedTraverse('@@link_redirect_view').absolute_target_url()
display_link = context.unrestrictedTraverse('@@link_redirect_view').display_link()

root_url = context.unrestrictedTraverse('@@plone_portal_state').navigation_root_url
if 'resolveuid' not in link_url:
    url = link_url
else
    url = root_url + display_link['meta']

this is what I use to display the Link absolute url. The real fix is to update @@link_redirect_view to provide a method to display the absolute_url. The Link type uses 2 fields, I think it should use just one to store the external url or the uid. Or ad an absolute_url method that resolve the uid url (maybe using the catalog?).

@yurj
Copy link
Contributor

yurj commented Nov 15, 2021

@jensens
Copy link
Member

jensens commented Apr 30, 2022

Is thi still a thing in Plone 6 a4 or later?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants