Closed (fixed)
Project:
Glossify
Version:
8.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Feature request
Assigned:
Reporter:
Created:
10 Feb 2017 at 08:52 UTC
Updated:
27 May 2017 at 09:59 UTC
Jump to comment: Most recent
If the node body contains the node title, a link/tooltip is put on the string causing a self reference.
As an example:
node title: "Level 1"
same node body: "To master level 1 you need bla bla bla"
In body field "level 1" will be linked to itself.
Comments
Comment #2
keesje commentedI agree. Anyone a good suggestion on approach? Look at the URL to see if whe are in node-page scope? what about node teasers then? or node fields listed in views?
Comment #3
keesje commentedThis is in now, please test. Matching words are skipped, of the current URL matches the URL that belongs to that maching word. Should work for both terms and nodes.
Comment #4
laravz commentedCan you point me to the code or commit that fixes this issue?
Comment #5
keesje commentedsure
/src/GlossifyBase.php
...
...
Comment #6
laravz commentedThe code fixes the issue for the node view page, however, the self reference remains on the preview, edit and draft node pages. That is, "node/xxx" is not considered a match for "node/preview/...", "node/xxx/edit" and "node/xxx/latest". Would it be an idea to compare the node id's themselves? We could explode the current_path for nodes and taxonomies and compare it to the id retrieved from the term.
Comment #7
keesje commentedI thought about that too. Its a slippery slope, data retrieved from node's or term's can show up in numerous ways and URL variations. On top of that it's possible that the data retrieved and parsed is not the "abbreviate" data itself but other field(s). I can imagine excluding those URL variations core provides though.
Comment #8
laravz commentedTrue. I had no problems with self reference when I used a query string, so for now it might be sufficient to identify the core URL variations and perhaps the ones provided by the content moderation module(experimental core).
Comment #9
keesje commentedSuggested approach: self-reference checking must have its own method, so implementations of the base class in glossify_node and glossify_taxonomy can implement their own.
Patches welcome.
Comment #10
keesje commentedBoldy marking this "fixed", since its good enough for visitors in most scenarios. Please open a new issue for further improvements, preferably with patch.