Closed (outdated)
Project:
Linkit
Version:
8.x-4.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
28 Nov 2017 at 18:31 UTC
Updated:
21 May 2024 at 02:41 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
oknateThis patch sets the text to the node title, and allows altering it with hook_linkit_default_node_text_alter().
Comment #3
oknateComment #4
oknateI added some error handling. I was getting a ResourceNotFoundException with external links.
This wasn't happening previously, so I think some core code must have been updated.
Also, since in the 8.x.5.x-dev branch a lot of this code has been moved into core, I created a core issue for this:
https://www.drupal.org/project/drupal/issues/2961554
Comment #5
oknateUpdating the patch, I found a bug where links were getting "" for the text.
Comment #6
firewaller commented(PATCH INVALID)
Comment #7
firewaller commentedComment #8
firewaller commented#5 works for me, but I added a little cleanup and moved the alter hook (renamed to "linkit_default_text") outside of the conditional statement so that it can be altered globally.
Comment #9
avpaderno(I am deleting the content of an attached file.)
Comment #10
firewaller commentedComment #11
dbielke1986 commentedComment #12
vatsalkhanna commentedI have reviewed the changes as per patch #8 and found an issue when an external URL is provided with the same path which exists on the site. It sets the node title if the path in the external URL matches the node URL.
Steps to reproduce:
Comment #13
vatsalkhanna commentedINVALID PATCH.
Comment #14
vatsalkhanna commentedAdded a patch to exclude the route check if the link is external.
Comment #15
avpadernoDrupal 8.9 requires PHP 7. Running tests on PHP 5.5 and Drupal 8.9 will fail.
Comment #16
vatsalkhanna commentedI have a condition where we have migrated path aliases from D7 to D8 site (nodes aren't), so patch #14 will start throwing an ajax error on saving dialog.
The "node" parameter was not converted for the path /node/{node}
This happens when we try to add the D7 node path (on linkit search dialog) which exists on the path_alias table of D8 though the node doesn't actually exist. So I am adding a patch for this special condition.
Note: Don't use this patch if you don't have this condition, use patch #14 instead.
Comment #17
vatsalkhanna commentedComment #18
vatsalkhanna commentedHere's the interdiff for #14 and #16. Please ignore the previous one.
Comment #19
mark_fullmerFor some time now, as indicated by the Linkit project page, the 8.x-4.x branch of Linkit is not undergoing active development.
To help the maintainers of the Linkit module better steward tasks under active development, I'm going to mark this issue as closed (outdated). Sites using 8.x-4.x can certainly continue to do so, but should make plans for updating to the latest supported version of Linkit.
Even better: Drupal core will soon provide link autocomplete suggestions in CKEditor similar to what this module does. Sites using or considering using Linkit should follow this core issue to evaluate whether they can use the core solution instead of Linkit. See feature differences below to compare what Linkit includes that will not initially be in Drupal core.
If this issue relates to a problem or feature request that is applicable to the latest supported version of Linkit, please create a new issue, associated with that branch, describing the bug or enhancement.
For participation and information in Linkit's roadmap, see #3345480: LinkIt Release Roadmap and Issue Prioritization.
Thanks, community, for you collaboration and consideration!
Comment #20
klidifia commentedI updated this issue with some code that will use the entity title (already obtained via Linkit) as the default link text for a brand new inserted link without a selection range: #3388565: Populate displayedText with entity title when left blank