When using this module with linkit in WYSIWYG linking to entities via UUID works fine. However, when I use linkit in a link field to link to entities via UUID I get a double language string in the url.

WYSYWG link: http://myhost/en/content/my-node
Link field: http://myhost/en//en/content/my-node

Same occurs for other entities: files, taxonomy terms, etc.

The easiest way to recreate this is to use the wetkit distribution: https://www.drupal.org/project/wetkit then:

0. Clone the linkit profile for content editors and change it to by of type 'field'
1. Add a link field on Basic Page
2. Add this field to the node_view for basic page Node (Wxt) in admin/structure/pages/edit/node_view
3. Add a basic page
(a) in wysiwyg body link to a node using linkit button (type more than 3 chars or autocomplete will not kick in)
(b) in link field use linkit (search button) to link to the same node
4. Save and view your node to see the different urls

It looks like this is hapenning because the link field runs the path through the url() function after uuid_link.module: uuid_link_tokens() does.

Comments

joel_osc created an issue. See original summary.

joel_osc’s picture

Status: Active » Needs review
StatusFileSize
new1.31 KB

Here is a patch that attempts to figure out if the link field is the context and then avoids calling url().

joel_osc’s picture

Status: Needs review » Closed (works as designed)

It looks like a custom renderer triggered this issue and uuid_link code is fine. Withdrawing issue.

ptsimard’s picture

Status: Closed (works as designed) » Active

I'm reopening this since I'm getting the duplicated language prefix using wetkit. I don't believe I'm doing any custom formatting like joel_osc mentioned.

This patch fixes the issue.

sylus’s picture

Pretty sure this is no longer an issue with updated patch here: https://www.drupal.org/node/2428185