Hello,

I have been using this module with D7 for many years and it's been of great help to projects. Now it is time for D8, and I've discovered a very important problem:

Linkit is generating incorrect links for all bundles.

Node: If I am viewing /node/5 for example, and want to link to /node/6, Linkit is generating a link to "node/6", which in effect becomes "/node/node/6" and 404s.
Taxonomy: Same issue as node with the linking, but also it is generating links to "node/taxonomy_term/1" instead of "/taxonomy/term/1".

Good news though is that the issues can be fixed quite easily I think. By just adding a "/" to the front of the Linkit URLs we should be able to fix the problem, as well as changing "taxonomy_term" to "/taxonomy/term". First I tried looking through settings, but couldn't find anything, so I tried looking for the files to make the change myself but I got lost in the sheer number of files in the module.

I have marked this issue as MAJOR since it is rendering the module essentially useless.

For your additional knowledge, I use this module in cooperation with Pathologic to keep all my URLs in sync, so I prefer Linkit to generate clean node ID and term ID URLs for Pathologic to process. In the event that a page's URL changes, I don't want to have to go and update all the nodes that link to it.

Thanks for a great module and I look forward to continuing to use it!

CommentFileSizeAuthor
#6 attributes.PNG11.95 KBanon
#4 Pasted_Image_7_23_16__5_03_PM.png115.86 KBsgp913
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sgp913 created an issue. See original summary.

anon’s picture

This does not make sense at all. There is something wrong with this report.

The raw links "node/4" is not used anymore with Linkit 8.x-5.x. That version is using a filter to parse the links from the data-attributes on the link.

With that said, there is no need for pathologic I guess.

anon’s picture

What version of Linkit are you using? And have you done an upgrade from the 7.x version?

sgp913’s picture

I am using a new D8 install 8.1.7 with 8.x-5.0-beta2.

I have attached an image for you to see the process.

EDIT: In my image, the last box should say "edit the node", not "edit the term".

anon’s picture

What kind of form are you using here? I don't recognize that from the image.

Have you enabled the Linkit filter plugin?

Also make sure that the "data-entity-type" and "data-entity-uuid" attribute is allowed in the <a> link in the HTML Filter settings if you are using that.

The href is "translated" in runtime now, and its based on the "data-entity-type" and "data-entity-uuid" attributes.
Example
<a href="whatever" data-entity-type="node" data-entity-uuid="[uuid for node 1]"></a>
is translated to
<a href="node/1" data-entity-type="node" data-entity-uuid="[uuid for node 1]"></a> when the Linkit filter have done its work.

anon’s picture

FileSize
11.95 KB

Well, Now I see. It is the regular form. My bad.

From the image I can tell you that you don't have the right a-link rules. See my image.

The hard coded href is not used if the data-attributes can find a match.

anon’s picture

Category: Bug report » Support request
Priority: Major » Normal
sgp913’s picture

Gotcha! I wasn't aware that a text filter needed to be enabled for it to function. That means we need one less module to get perfect links!

In the case that the user doesn't have the filter enabled, shouldn't the hard coded href at least link to the raw URL instead of 404ing? Without the filter enabled, all the links are essentially broken.

I have used this module in conjunction with a mobile native app before on D7 and had the app render the textarea field without Pathologic processing and appreciated the convenience of having the raw URLs there for REST services as I could continue using the <a> links by utilizing the node/term number directly from the URL.

Thanks for your help

anon’s picture

Status: Active » Closed (works as designed)

In the case that the user doesn't have the filter enabled, shouldn't the hard coded href at least link to the raw URL instead of 404ing? Without the filter enabled, all the links are essentially broken.

No, the filter is required in order to keep things simple. Without the filter, there is so much that need to be checked in order to construct a valid href, like lang suffix, aliases, and pretty mush all bug reports that is assign to 7.x now.