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.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | double_language_prefix-uuid_link-2562639-2.patch | 1.31 KB | joel_osc |
Comments
Comment #2
joel_osc commentedHere is a patch that attempts to figure out if the link field is the context and then avoids calling url().
Comment #3
joel_osc commentedIt looks like a custom renderer triggered this issue and uuid_link code is fine. Withdrawing issue.
Comment #4
ptsimard commentedI'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.
Comment #5
sylus commentedPretty sure this is no longer an issue with updated patch here: https://www.drupal.org/node/2428185