Provide a new autocomplete form widget for link fields to query entities from a chosen Linkit profile.
Issue fork linkit-2712951
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
anonFor internal links I think you should go for an entitiy reference field. Makes no sense to have that as a link field anymore.
Comment #3
beltofteI would say that it does still make sense to support Linkit for field types using autocomplete like entity reference fields, link fields (if you enabled links to local content).
Finding content using the native autocomplete in Drupal core can be really hard for editors if you have a lot of content and have multiple nodes with the same title. And this is where LinkIt makes the editor experience much better, because the profiles can be configured to show more info about the entity than just title and id.
I'm personally maintaining
https://www.drupal.org/project/linkit_references and would like that moved to D8 for entity references, but not sure if that is possible at all without the field support in version 8.x-5.x of the Linkit core module.
Comment #4
dwkitchen commentedI would agree on the need for support for the Link field.
I have a Link field that can have either links to internal or external content. I can't change it to a reference field as that would block use of external links.
Comment #5
tne_ commented+1 for this feature in D8
Comment #6
thib+1 for this feature in 8.x-5.x
Comment #7
frank.schalkwijk commentedI made my first Drupal 8 patch so it might not be very good, but it works for regular link fields and link fields in paragraphs.
I decided to make a new Linkit widget for link fields, so to use this widget you need to select it on the form display tab and select a profile in the widget settings.
Comment #8
frank.schalkwijk commentedI saw that my patch relies on file_entity. I'll try to fix it so that it doesn't rely on file_entity.
Update: I did not get my patch to work without file_entity.
Comment #9
frank.schalkwijk commentedI updated my patch a little because there was a problem.
When a user typed a url in the form of a internal url (like: 'google.com') and clicked the autocomplete result, the 'href' hidden field got set. The validation would fail, because this is an incorrect internal path. The form would be reloaded and when the user fixes his error by typing in 'https://google.com', but not click the autocomplete result, the hidden field would keep its previous value. I fixed this issue by not using the href hidden field, but instead use the value of the uri field.
I also fixed a wrongly indented array and removed the 'Selected link:' text, because it was redundant.
Comment #10
badrange commentedI suppose the correct status for this issue is 'Needs review' now that there is a patch?
Comment #11
welly commentedTested the patch and it doesn't apply to the latest dev version. May try and fix it but if @frank.schalkwijk wants to take a look as the patch author, that would be great.
Comment #12
maio1980 commented+1 for this feature in 8.x-5.x
patch doesn't apply to the latest dev version
Comment #13
leo pitt commentedDitto - this feature would be very useful. Entity reference is good for linking to only internal content - but does not work if you want to provide both internal and external links.
Attempted to amend the patch but it proved beyond my ability.
Comment #14
duncan.moo commentedI have taken the patch above, which I could not get to work, and created a module linkit_widget.
It would make far better sense for this to be incorporated into the Linkit module, perhaps as a sub-module? But I created a separate module to avoid the un-merged patch state we have on this ticket. (@anon any chance of getting this into Linkit, the use-case is solid).
There are some issues on the linkit widget, like if you have more than one on a page :); if it was a patch or a sub-module we could fix that in autocomplete.js (I think).
Comment #15
josh.fabeanThis needs to be a thing! This module creates a better way for you to create links, so why shouldn't it work with the built in way to create links?
Comment #16
spadxiii commentedRerolled the patch so that it applies on current dev again. The only changes that didn't apply were in the autocomplete.js.
Comment #17
tessa bakkerComment #18
recrit commentedWith patch #16 if there are multiple link field items on the form, then all open up at the same time.
The attached patch ensure that the "click" event only operates on 1.
Comment #19
recrit commentedupdated the element used to search upon the click event as well.
Comment #20
recrit commentedAdded JS to auto-populate the link title if it has not been manually set.
Comment #21
mbovan commentedThe above patch works fine with populating the link title but breaks the links placed via CKEditor.
Not sure about the unset logic in
linkit_form_editor_link_dialog_submit()but removing it fixes the issues.Comment #22
mbovan commentedAs the substitution doesn't work for link fields, this patch aims to do so. It adds a new
LinkitFormatterwhich overrides the URL and replaces it with the generated/substituted one.Also, moved utility classes from the
LinkitWidgetinto a new helper class.Thoughts are very welcome.
Comment #23
mbovan commentedAdded schema for the linkit widget and linkit formatter.
Comment #24
leo pitt commentedWhen I tested the other day it looked like the show/hide link text option in field settings was not being respected, will need to check again though.
Comment #25
dddbbb commentedJust tried the patch in #23 and it seemed fine. I haven't tried the formatter yet though (was using Link's "Separate link text and URL" instead).
Comment #26
mbovan commentedAn improvement that adds a possibility to link multilingual content correctly.
Also, when touching
LinkitHelperreplaced$entity->GetEntityTypeId()with$entity->getEntityTypeId()call.Comment #27
mbovan commentedComment #28
mbovan commentedMissing comment from #27:
Having this inside if condition prevents updating a link from internal to external.
Without conversion (generated URL to URL object) the formatted doesn't work for entities.
However, a substitution plugin should return a URL object instead IMO. Not sure if that is going to work for files though...
One more thing I spotted, the linkit widget fails to select a file via autocomplete as
Url::fromEntityUri()can't create a URL for file entities (There is no canonical link template for files).We could think about writing test coverage for the current code.
Comment #29
hudri+1 for this FR, for link fields allowing both internal and external links we can't use entity references, and LinkIt is a huge improvement in UX
Comment #30
pivica commentedMade a bug report in #2916023: Deleted linkit entity produce fatal exception and when i started to create a patch i figured that we are using patched version of module from this issue.
We have a quite a big problem with a next scenario. We have a node with paragraphs which can have linkit field to other nodes. If linkit node is deleted then when you view parent node next PHP fatal error is generated:
The website encountered an unexpected error. Please try again later. TypeError: Argument 1 passed to Drupal\Core\Entity\EntityRepository::getTranslationFromContext() must implement interface Drupal\Core\Entity\EntityInterface, null given, called in.../web/modules/contrib/linkit/src/Utility/LinkitHelper.php on line 21 in Drupal\Core\Entity\EntityRepository->getTranslationFromContext() (line 82 of core/lib/Drupal/Core/Entity/EntityRepository.php). Drupal\Core\Entity\EntityRepository->getTranslationFromContext(NULL) (Line: 21) Drupal\linkit\Utility\LinkitHelper::getEntityFromUri('entity:node/108') (Line: 121) Drupal\linkit\Plugin\Field\FieldFormatter\LinkitFormatter->getSubstitutedUrl(Object) (Line: 99) Drupal\linkit\Plugin\Field\FieldFormatter\LinkitFormatter->viewElements(Object, 'de') (Line: 80) Drupal\Core\Field\FormatterBase->view(Object, 'de') (Line: 259) Drupal\Core\Entity\Entity\EntityViewDisplay->buildMultiple(Array) (Line: 320) Drupal\Core\Entity\EntityViewBuilder->buildComponents(Array, Array, Array, 'primer_teaser_grid') (Line: 263) Drupal\Core\Entity\EntityViewBuilder->buildMultiple(Array) (Line: 18) Drupal\paragraphs\ParagraphViewBuilder->buildMultiple(Array) (Line: 220) Drupal\Core\Entity\EntityViewBuilder->build(Array) call_user_func(Array, Array) (Line: 376) Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195) ...The problem is in LinkitHelper::getEntityFromUri() method which will try to load entity that not exist and then pass it to the getTranslationFromContext() method, and this produce fatal error.
Here is a quick change for now that will fix this quickly until we figure better approach.
Comment #31
hudriAdding another use case in hope to get some momentum on this issue: Linking to media entities.
The core link field autocomplete does not work with multiple different entity types, and the single entity-type is hardcoded to node.
Comment #32
miro_dietikerThe link field of Drupal supports providing a fragment to link targets. This linkit implementation always drops the fragment.
However, with the linkit UI, we also need to figure out how we would display / edit that fragment part. That's related to: #2902875: Make the selected item not look like text
Comment #33
miro_dietikerFrom tests i discovered that if the link target title contains a special char like "&" it leads to double encoding in the link label.
Comment #34
johnchqueWorking on this.
Comment #35
johnchqueAfter lots of research found the escaping problem. It basically escapes the label of the node and when building the suggestions it retrieves it in the same way, escaping. So when clicking the suggestion it just copies the raw value of the retrieved suggestion for the label.
The change should work for labels, keeping the URL as it was.
Comment #37
johnchqueI don't see how this change might affect the current functionality. Using a better var name.
Comment #38
berdirAre you sure that this issue specifically only affects the link field and not also the link button in WYSIWYG? If yes, then it should be a separate issue. I guess it will conflict though because the changes will also overlap.
Comment #40
miro_dietikerYeah sorry, tested in WYSIWYG and it's the same.
Created dedicated issue.
Comment #41
cameron prince commentedFor those interested, I've created an add-on for this feature at https://www.drupal.org/project/link_attributes/issues/2939514 which adds a new widget based on the one provided by this patch. The new widget combines the attributes provided by link_attributes module with the linkit selector for link fields.
The work there is based on the patch at comment #30.
Comment #42
cameron prince commentedHere's an updated version of #30 to address recent updates to dev.
Comment #43
johnchqueI think this should fix the tests.
Also removing a problem we had with inline form errors module:
Adding patch against old dev same as #30 and against current dev.
Comment #46
johnchqueNot really sure why it fails, it basically says the 'data-entity-type' is added to the link but manual test says that it isn't.
Comment #47
marcoscanoWorking on this.
Comment #48
marcoscanoThis should fix the existing tests I think. Also changed some CS violations along the way.
Will be working on writting tests for the new widget/formatter next.
Comment #49
marcoscanoThis adds a test that should cover the most basic scenarios for the widget and formatter.
Anything else we should test?
Comment #50
marcoscanoA small improvement that preserves the fragment (#anchor) from entity URIs when used in the field widget.
Comment #51
berdirLooks pretty good, didn't really review the JS though.
maybe we can use a better variable name for this, looks like it is related to translation but it isn't.
$this->t()
This helper uses quite a few services, seems like it should possibly be a service too that is injected into the widget (and formatter, if used there)?
I think phpunit has an assertcontains(), maybe also include the ID here in the check?
Comment #52
marcoscano@Berdir thanks for reviewing!
This addresses #51 except for #51.3:
Both helper functions are declared as static, and one of them (
getEntityFromUri()) is called in a static context from\Drupal\linkit\Plugin\Field\FieldWidget\LinkitWidget::getUriAsDisplayableString(), which is overriding core's\Drupal\link\Plugin\Field\FieldWidget\LinkWidget::getUriAsDisplayableString().The other helper (
::getUriFromSubmittedValue()is apparently not being called in a static context, not sure why it was initially created as static on this patch. Do you think it's worth making this a service and having only this method non-static?Comment #53
berdirYou are creating the entity that you are using for tests here and have it in $entity, shouldn't be necessary to load it again with a query?
Ok, that one usage of the helper is static is a bit unfortunate, but we are using several services, so if we ever want to write unit tests for some logic in there, it would be a lot easier to do so when it is a service. The none call needs to use \Drupal::service() but that's not a big deal.
Comment #54
marcoscanooops, that is indeed not necessary :)
Thanks!
Comment #55
marcoscanoThis restores the behavior from patch 30 (that was lost at some point along the way) of showing the selected entity's label in the URL field, instead of /node/23 or something like that.
Also, improved the test coverage to cover external URLs and anchor fragments as well.
Comment #57
marcoscanoOK, trying not to break it elsewhere now.
Comment #59
marcoscanoComment #60
afoster commentedI've tested the patch in #59 against 8.x-5.0-beta7 and it worked for me. Thank you!
Comment #61
berdirthe description seems backward, we are making that it is equal?
Could be fixed on commit but maybe @marcoscano has a minute to confirm and update the patch.
We also use this and it would be great if we could finally commit this. This issue has 53 followers, so lots of people are interested in this, would be amazing if we could finally get switch to a non-patched version of linkit. We've been using different patches from this issue for a year or so and have been testing it extensively.
Comment #62
marcoscanoYeah the assert* message parameter is always confusing... lately I've just stopped using them, they are IMHO hardly needed to understand a given failure anyways...
This message is actually shown when the test fails ( https://github.com/sebastianbergmann/phpunit/blob/6.5.7/src/Framework/Co... ), so in this case I believe the message should indicate that the label is *not* what it is expected, isn't it?
Maybe I'm missing something, let me know if that's the case!
Comment #63
marcoscanoNew bug (or arguably unexpected behavior) found here.
Steps to reproduce:
1) Apply this patch and configure a node link field to use this widget
2) Create a node with an internal route on the link field
3) Open the node edit form. Type an external route, such as "https://google.com"
4) Do not click on the dropdown suggestions. Instead click "Save" to save the node directly.
You would expect that "https://google.com" gets saved, but instead the internal route that was previously stored in the element attributes overrides that. If you click on the dropdown suggestion that says "Linkit could not find any suggestions. This URL will be used as is", however, everything works as expected.
I'm not very fond of my javascript skills, but I don't see any other option apart from resetting the attributes everytime a new key is pressed, once the user can write / select / write something different / etc several times, so we can never ensure the attributes are well defined, except when they click on the dropdown (after which no keyup should happen anymore).
Thoughts?
Comment #65
marcoscanoTests++ :)
I had forgotten the anchor-feature... (too many features...)
So I guess we may have a conflict of expectations here...
In a node where a previous route to an internal link (for example "Related product Foo") exists:
- User A wants to be able to write "http://google.com#some-fancy-anchor" and then directly click save. He/she expects that this external URL will override the internal route previously saved.
- User B wants to be able to just add #some-anchor-text to the existing internal route title, so the link points to the correct fragment/anchor when saved. After writing the anchor in the text field (which would become then "Related product Foo#some-anchor-text"), he/she doesn't click on anything, only on "Save" to save the node. His/her expectation here is that the internal route is preserved and the anchor added.
Who should win?
Comment #66
cameron prince commentedI understand your predicament... You might consider expanding the "Link attributes" module to include a fragment field and use the patch I created in #41 to integrate "Link attributes" with "Linkit for link fields."
Good luck!
Comment #67
marcoscanoOK, so after thinking about this for a while, we decided to prioritize the "current" functionality, and maybe just try to improve some descriptions.
This patch tries to make it a little bit clearer that you need to effectively click on the dropdown, even if there are no matches.
The interdiff is against #59 because we should then disregard patch #63.
Comment #68
erichomanchuk commentedI get an issue with using the patch and trying to link to an article that has an ampersand "&" in the title. Using version 8.x-5.0-beta7 when I link to an article using linkit in the wysiwyg everything works as expected. After applying the patch and linking to an article that has an ampersand in its title e.g. "Fees & Services". Then the title is used as the href for the link.
Before patch source code:
<p><a data-entity-substitution="canonical" data-entity-type="node" data-entity-uuid="8826c7a2-d761-4205-b565-fe2daad14944" href="/node/1">link</a></p>After patch source code:
<p><a href="Fees &amp; Services">link</a></p>Comment #69
merilainen commentedI can confirm problem mentioned in #68.
Comment #70
idflood commentedI think that I have found another issue. I initially feature request since I would like to reference files from the link field (not part of a media). With the patch the files are shown in the autocomplete as expected but I can't save the node as it raise an error: "1 error has been found for: Links (value 3)".
The hidden inputs (entity-type, …) look correct.
edit: I disabled the "inline form errors" module and the error is more helpful I think: The path 'my_file.pdf' is invalid.
So the error come from LinkTypeConstraint.php from the core link field.
edit2: The error is in fact in LinkNotExistingInternalConstraintValidator.php, it raise a `RouteNotFoundException`. The Drupal\Core\Url object has a routeName "entity.file.canonical" and as a routeParameters `file` => `78` which looks right.
edit3: The "entity.file.canonical" is defined in the file_entity module but I have it disabled so that's why it doesn't work. I think it should not be a requirement for this module to work with files or I may have a strange config here.
edit4: The issue https://www.drupal.org/node/2423093 may be related to this.
edit5: So I compared the uri given by getUriFromSubmittedValue with a file loaded by id and using the "getFileUri" method on the entity.
The getUriFromSubmittedValue() return this: 'entity:file/86'
The getFileUri give me something like 'public://2018-06/myfile.pdf'
So the issue is in getUriFromSubmittedValue from LinkitHelper.php where if there is an entity the uri is "hardcoded" as this: '$entity_uri = 'entity:' . $entity->getEntityTypeId() . '/' . $entity->id();'
edit6: I tried to add this code to getUriFromSubmittedValue so that the uri returned for files look like the "public://" but I now get this LinkExternalProtocolsConstraintValidator from the link module.
Comment #71
danjordan commentedI have installed the latest patch and when I try and link to a media file, the link points to the file media entity rather than a direct link to file.
I have double checked and my LinkIt profile has the "Direct URL to Media File Entity" selected.
Are others having the same issue or I am missing something?
Comment #72
idflood commentedI tried to enable the file_entity module and now it is working as expected : ) It would be great if this was not a requirement or if it is display a warning when we enable the "file" matcher about this.
@danjordan maybe check that you are using the "linkit" formatter on the manage display tab, by default it still use the standard link formatter.
Comment #73
danjordan commentedThanks @idflood. That got it.
Comment #74
freddya21 commented@danjordan I ran into the same issue where
I have also double checked and my LinkIt profile has the "Direct URL to Media File Entity" selected. And that I am using the "linkit" formatter on the manage display tab.
Did you have to do anything else to get the Linkit Link to generate a direct link to file.
@Thread
What's strange is that the WYSWYG editors have an optional LinkIt filter that Runs if checked which Converts entity:node/1 into a "real" URL when rendering
the text but I'm not sure how that optional Filter is handled outside of the Content Editors; for instance, when the Link is just a field on a content type.
Comment #75
danjordan commented@freddya21 that was all. I am using version 5.0-beta7 of Linkit module. Installed latest patch, cleared all caches and that got it to work for me.
Comment #76
freddya21 commentedThe problem was that I was using a Custom LinkIt Profile that I had added; and apparently the Custom LinkIt Profiles are Ignored when It comes to Leveraging LinkIt to publish Fields-based Links. I even made sure to select my custom profile under the Form Display Formatter. So in order to get it to work I ended up having to Make my desired selection within the Default LinkIt Profile.
Also Noticed that there is an issue where Field-based LinkIt Links that point directly to the underlying Media file; they require the cache to be flushed before it will show the new URL. This isn't the case with WYSWYG LinkIt Links, they show the latest media files without flushing the cache.
Issue Summary:
Comment #77
ahebrank commentedAnother quirk I noticed when using this in conjunction with simple (non-entity) matchers (i.e., Email), at least in the context of a wysiwyg: the returned href value is the autocomplete label, not the path. The attached interdiff against #67 sets the href to the raw path if entity matching is *not* used; I'm not at all confident this is the right fix or a good idea but it seems to fix the immediate problem.
Comment #78
idflood commentedI found another issue. Our website is translated in 2 languages, german and french, with french as the default language.
Eventually when we edit a german page and try to link to a translated page in german the link is invalid (only the title in href, no data-* attributes).
The problem comes from this check in `linkit_form_editor_link_dialog_submit`:
The '$href' is correct as this correspond to the translated page title. But the $entity we compare against is not translated so the condition doesn't work here.
In the updated patch I added `$translation = \Drupal::service('entity.repository')->getTranslationFromContext($entity);`, but it might not be right in all situations I think. Ideally we should load the translation according to the selected item and not from context. For example the current approach might cause an issue when trying to link to a french page when editing a german page.
This condition has been added in #57 by @marcoscano, maybe you can help here?
Comment #80
titouilleHi,
Everyone can explain to me why don't using this :
instead of this :
in linkit_form_editor_link_dialog_submit handler from linkit.module.
By using the $href_dirty_check variable (ie node/1234), we are sure that the link will work in any language, even if the alias change after some modifications on the target entity. In this case, the multilingual support is ok and the target will remain because we map the internal link instead of an alias.
By using the alias, we can't assure that the link will become dead after modifications.
But maybe you have a good reason to do it like this ?
Thanks in advance for any explanation.
Comment #81
rudins commentedHi,
New 8.x-5.x LinkitFilter makes sure new alias is rendered after alias changes. But it works only if links is added using new 8.x-5.x LinkitDrupalLink CKEditor plugin.
So, I ended up creating additional filter to process internal paths that are not created using new Linkit approach with data-entity attributes.
I agree with @titouille regarding setting href value as internal path, for consistency. LinkIt filter should be used in any case, let's generate url from internal path.
Adding modified patch with
$href_dirty_check.Comment #82
dddbbb commentedComment #84
ahebrank commentedShould hopefully fix the null $entity testbot error in #81 and also deal with html entity encoding quirks as mentioned above a few times.
Comment #85
jesconstantineThanks for working on this! Is it possible to include the functionality of indicating the Link Text as required with an asterisk when there is a URL populated like the core link field widget does? I appreciate adding the referenced entity title automatically, but in the event that an author wants to overwrite it and they delete the title, it would be nice to have an indication that something is required. I can confirm that the post-submit validation does work, just looking to improve the UX in this respect.
Comment #86
jesconstantineHave folks been able to implement this successfully with multiple instances of the linkit widget on a node edit form?
I'm getting an ajax error (whose symptom is the progress wheel spinning, but no dropdown of entities) with the following field setup on a node bundle:
* Link field on the node (linkit widget, functions as expected)
* Paragraphs field > Paragraphs field > Link field on paragraph (linkit widget, does not function)
To rule out Paragraphs ajax conflicts, I've also added an additional link field to the node directly and have gotten the same results:
* Link field on the node (linkit widget, functions as expected)
* Second link field on the node (linkit widget, does not function)
In both cases, I get the following ajax error in my console:
I've applied this patch to the 8.x-5.x-dev version. Please let me know if I can provide any other context.
Comment #87
berdirI don't think that has anything to do with this issue. It looks like yoast_seo is interfering there:
....
Drupal\yoast_seo\EntityAnalyser->renderEntity(Object) (Line: 69)
Drupal\yoast_seo\EntityAnalyser->createEntityPreview(Object) (Line: 78)
Drupal\yoast_seo\Form\AnalysisFormHandler->analysisSubmitAjax(Array, Object, Object)
....
Combined with this:
Drupal\value\ThemeManager->buildValues('node', Array) (Line: 22)
I don't know what that module is but it seems to be replacing the core theme manager and for whatever reason serialize it and you can't do that with unsaved/new entities...
Comment #88
jesconstantineThank you @Berdir I definitely missed that in the stacktrace. Sorry for crowding the thread with that noise.
I think I determined what was happening for me. When I switched the widget for the field on the node, I also checked the settings for the field widget which resulted in the linkit profile name being saved:
And as a result the ajax request is made to the proper path for that linkit profile:
When I switched the widget for a link field on my paragraph, I didn't need to see the widget settings so I never opened them and as a result, no linkit profile was saved:
And as a result the ajax request is made to a path which returns nothing:
I only have 1 linkit profile, so it'd be great to have that set by default without needing to interact with the field widget settings - but at least now I have a workaround.
Hope this helps.
Thanks
Comment #89
berdirThe recent changes fixed various problems, but for example the html encoding issue should instead be done by decoding in javascript (with https://api.jquery.com/jquery.parsehtml/) so that things like " also correctly show in the editor. I also think the dirty check is now broken, if you for example manually change to a path after selecting an entity, it will ignore that.
I'm wondering if we should remove the label stuff completely from this patch and leave that to issues like #2966320: Show entity title after autocomplete selection instead of internal route (e.g., /node/123). This patch is already doing too many things.
Comment #90
ahebrank commentedAdding in this combination of 84 and 77, with some additional checks to try to handle edits after the initial link is created.
In the submission callback:
This is a mess... but seems to work so far.
Comment #91
arpad.rozsa commentedMade some changes with the email matching:
Comment #93
arpad.rozsa commentedFixed the failing test, forgot to enable the email matcher.
Comment #94
ahebrank commentedThis adds a minor tweak to 93 to do quote htmlentity conversion (the real fix is probably berdir's suggestion above for front-end processing of these characters).
Comment #95
ahebrank commented(I don't know what the actual magic entity decode that matches the translation label, but here's another version that uses the top answer on http://php.net/manual/en/function.html-entity-decode.php)
Comment #96
johnchquePlease @ahebrank we need the interdiff agains the previous patch so we know what has been changed. Could you upload that please?
Comment #97
ahebrank commentedWon't Gitlab be nice, someday?
It's just this line in the .module file. Originally:
vs. in 94:
or in 95:
Comment #98
berdirI think we should always use the path field and drop the logic that resolves the label back to the entity.
Comment #99
arpad.rozsa commentedFixing yet another problem, not related to the labels though. Basically what happened was that the linkit autocomplete conflicts with the core autocomplete when it initializing the field. This happened, with fields in paragraphs, but either way this could be a problem with fields directly on nodes as well.
I have a paragraph with a linkit field and another with a field that uses the core's autocomplete widget. Add the paragraph with the linkit first on a node form then the other one. There will be a javascript error in the console, which doesn't really break things, but in the second field with the autocomplete widget, the returned results will be rendered as in the linkit field, which is a problem, because the two should have different designs.
Hopefully this description is clear enough to see what my changes aim to fix.
Comment #100
arpad.rozsa commentedAs suggested dropped out a lot of code which corresponds to showing the labels. So we are back again at showing the paths in the url field.
Comment #101
xenophyle commentedI tried this patch and I'm having trouble getting it to use the Media Substitution. In LinkitFormatter::getSubstitutedUrl() the PHP URL scheme for a media link is internal, not entity. I am using the default Linkit profile both for the form display and the link field formatter. This is with Linkit 8.x-5.0-beta8.
Looking deeper I see LinkitHelper::getUriFromSubmittedValue() is setting everything except to "internal:".
Comment #102
xenophyle commentedI modified the previous patch by adding code to getUriFromSubmittedValue() from the patch in comment 99.
Comment #103
blazey commentedAdded query parsing. The patches so far only preserved the fragment and the query part wasn't saved.
Comment #104
blazey commentedAdded query and fragment support when the user clicks on the popup.
Comment #106
blazey commentedFixed a regression introduced in #104.
Comment #108
blazey commentedOk, it turns out users are really confused with the input change, so here's a patch that shows the linked entity in a separate item and always shows the input as a url. It looks like this:
Comment #109
blazey commentedComment #111
blazey commentedComment #112
miro_dietiker@blazey Thank you for the improvements.
IMHO we should keep the scope of this issue limited so that a commitable state is reached. Most importantly, all critical functionality added here was test covered while your additional extensibility points 2. / 3. seem not to be covered. For instance as a regression, the link does not open in a new tab, easily resulting in data loss if the user clicks it... We're now back to WIP.
Comment #113
blazey commentedThank your for the review, sir! Good point about the link opening in the same tab. It's been addressed in the attached patch. Moreover:
So, to sum up, all of these inputs are now valid
and will be connected to the underlying entity. The decision whether to transform an absolute link to a relative version can be changed with
hook_linkit_host_is_internal_alter().Unfortunately, we don't have any additional resources to add test coverage at this point. We're sharing what we can, though.
Comment #114
johnchqueLet's trigger testbot.
Comment #116
blazey commentedFixed the coding standards and the path alias matching logic.
Comment #118
blazey commentedPrevent an exception that was thrown for certain uris in a specific situation (when editing values that were created with the core link widget).
Comment #119
anonFirst off, thank you all for the work and patiens on this issue.
I have read all the comments and there is many different things going on here, which is good, but at the same time I'm having a hard time wrapping my head around all of them.
I have tested the latest patch and it seems ok.
Some small things:
This needs to be fixed.
Also the patch fails as the JS functional test class is extends
JavascriptTestBase, but should now extendWebDriverTestBase.Comment #120
anonA test is also failing
testLinkFieldWidgetAndFormatterComment #121
stefan.hartono commentedWhen I tried to enter mailto: link
it prevents me from entering it and it said the path is not valid
is there anyway to fix that ?
Comment #122
stefan.hartono commentedI modified the validation so that the email link (mailto:) can be added.
Comment #123
stefan.hartono commentedEnable URL directing to add and edit form to be valid
Comment #124
bobbygryzyngerI can confirm #123 addresses validation issues with internal content creation paths.
Comment #125
esdrasterrero commentedSelect first available linkit profile if there is any configured. (Instead of default)
Comment #126
hudriI'm currently using #118, but it has a major issue with optional link texts:
Given a link field with an optional link text, when you select a node, then the link text field is prefilled with the node label.
A user can override the link text with a custom text, the custom text is stored correctly. But a user can not remove the link text and store an empty value, instead the link text is always filled with the node label on entity save.
Before #118 we have been using patch #59, which didn't have the optional link text issue, but we had to move forward due #78's multi-linguality issue.
I think this problem was introduced in #108 in LinkWidget::massageFormValues
I believe those lines prevent an optional, empty link text.
Comment #127
berdirI'm not sure why we have to add so much low-level logic and add (undocumented) hooks.
There is \Drupal\Component\Utility\UrlHelper::isExternal() and \Drupal\Component\Utility\UrlHelper::externalIsLocal(), can't we use that?
Again, as before when we've split off features from earlier patches, the more things we add here, the harder it is to get it committed.
I know it's hard because this introduces so many changes that it's very hard to combine it with other patches.
So lets try to keep not strictly related changes/improvements to a minimum and get this committed and then continue in smaller, more focused issues.
As commented in #119, all important functionality here needs to be covered with tests, and the more things we add, the harder that is as well.
Comment #128
arpad.rozsa commentedAs discussed before I removed that rendered 'Linked entity' feature introduced in #108 as it should be a separate feature and also it might conflict with the idea to show labels again in the url field, but this should remain outside of this patch.
Also removed the ability to alter the display url in the linkit widget and the alter to override if the url should be handled as internal or not. As discussed with @berdir, this was probably added for specific use case, but doesn't make much sense to use it as it could introduce some issues if the urls are not properly altered in the right format.
Refactored the changes from #122 as it add a new variable to store the host to check if the url is a
mailtolink, but there was already a host variable to use.In the
LinkitFormatterI added the linkit profile as a configurable setting, to be able to use profiles other than the default. Also added a description that says that the profile must be the same as on the widget, because different profiles can cause dissimilarities when editing or viewing a content. There was an attempt for this in #125, but the changes there weren't working properly, since it would always select the first available profile, which is mostly the default one.As pointed out in #126 the link title shouldn't be set even if it's empty.
@blazey added this, but I didn't experience such problems and it doesn't make sense to set the title after saving the widget.
The
LinkitHelperis more functional now so I didn't change it too much. As it was suggested in #127 I changed the way we detect if the url is external or internal inLinkitHelper::uriFromUserInput().Changed the FrontPageMatcher a little bit to match the front page by path as well.
Added new tests to test the url converting from an external url using the current website's host to a relative url. And also a test for the front page.
One, sort of new bug that I found is in the file matcher, but it might also make sense to leave this for a separate issue and I think there are already some issues on improving the file matcher. Anyway the problem is matching the relative path to the file, after users choose from the returned list. Searching is done by typing in the filename e.g.
new-logo.png, which would return a path like/sites/default/files/new-logo.png. After having this path in the field, the file matcher won't give us any results, because it only searches by the filename.Comment #129
jigariusTried the patch in comment 128 and it works very well for me. I still haven't put it on prod, but at first glance, it seems to be working correctly.
Comment #130
jeroentSetting back to needs work since the tests are failing.
Comment #131
karlsheaReroll for latest beta. Only change from #128 is changing js/autocomplete.js to js/linkit.autocomplete.js.
Comment #132
karlsheaOops
Comment #133
miro_dietiker@KarlShea Interdiff is missing. Setting to Needs Review to trigger testbot.
Comment #134
kevinquillen commentedThis patch appears to mostly work, but I noticed that if you have multiple query params of the same name that even though its saved in the database exactly as you entered it, when it is output on the page, you only get one of those parameters.
For example:
/search?facet=foo:bar&facet=baz:foobar&page=10&resultsPerPage=15Displays on the page as:
/search?facet=baz:foobar&page=10&resultsPerPage=15How can I change the behavior to not do that?
Comment #135
arpad.rozsa commentedFixed the failing test, which was caused by the test case not finding page titles even though the title is present. So I removed those checks completely, since we have other checks to make sure we are on the right page.
Fixed a PHP warning in the FrontPageMatcher, when the url doesn't have a query or a fragment.
@kevinquillen What you discovered above is not an issue with this patch or module it is a core issue as of my testing. I think this is the issue for the bug: #2885351: Query string duplications
Comment #136
lendudeFor the title test fail, see: https://www.drupal.org/project/drupal/issues/2870453#comment-12102425
If you change titleEquals to
(so ->getText() changed to ->getHtml()) the test is green. Not using that assertion in a JS test seems best I guess, or open a core issue to update titleEquals on
\Drupal\FunctionalJavascriptTests\JSWebAssertComment #137
arpad.rozsa commentedFixed the last test fail due to the test bot running in a subdirectory and the front page matcher test expected to see just
/.Regarding the title tests, I'm going with this option from @lendude's comment.
Comment #138
berdirWe can't hardcode it, because now it fails when you don't have a subdirectly.
I'm also not sure that the fix needs to be in the test, it's more likely that the actual code is broken. The link field should always be relative to the drupal root, so the parsing logic need to make sure to not store the directly.
Comment #139
arpad.rozsa commentedYou are right about hardcoding, now I'm loading that URL from the route. The parsing logic doesn't have any problem with this though, because the drupal root will contain the subdirectory, if your server is setup like that.
Tested it locally and got the same results. Put drupal into a subdirectory e.g.
/var/www/html/subdirectoryand setup apache virtualhost to have the doc root one directry above drupal's root i.e./var/www/htmland then Drupal's root url will belocalhost/subdirectory/.Comment #140
arpad.rozsa commentedHad a discussion with @berdir and the problem is using
Url::fromRoute('<front>')->toString()which is good for display, but shouldn't be used for storing data. So my previous comment is irrelevant, changed back the test to check for/and in the FrontPageMatcher also saving that directly instead of usingUrl::fromRoute('<front>')->toString().Comment #141
danjordan commentedHi
When I try and add a tel: link to a link field using linkit, I receive the following error
InvalidArgumentException: A path was passed when a fully qualified domain was expected. in Drupal\Component\Utility\UrlHelper::externalIsLocal() (line 265 of /app/web/core/lib/Drupal/Component/Utility/UrlHelper.php).
I am experiencing the issue on several sites. Is anyone else experiencing a similar issue with the latest patch?
Thanks
Dan
Comment #142
paulmartin84 commentedIm really not sure what the below code is trying to do, I have removed it in the attached patch because it is causing problems for me. Looking back it seems it was introduced in #108 without too much explanation.
If you add a page view with a contextual filter and a example path of "example-page/%taxonomy_term" where %taxonomy_term is a named route parameter, and then you try and link to this view using a link field with the linkit widget and an example link "/example-page/term1"
The below code finds the route correctly as a view and then it starts looking at the routes parameters which returns taxonomy_term and this results in an error whilst trying to save. Ideally it would just leave this manual link alone entirely.
I'm struggling to see why it is looking at what entity type a route's parameters might be. Does anyone have an example of when this might be useful?
Comment #143
paulmartin84 commentedComment #144
paulmartin84 commentedComment #145
blazey commented@kevinquillen that is a bug in PHP's
parse_strfunction. See #3038774: Url only outputs the last value of a query parameter for details.Comment #146
primsi commentedSmall d9 compatibility related change. Patches from 143 or 144 did not apply and wasn't quite sure about the reroll, so this patch builds atop of #140.
Comment #147
primsi commentedOverlooked the form - view difference.
Comment #148
primsi commentedWe noticed that submitting invalid input as link can lead to fatals on save, ie: tel:0123456. Adding that to patch.
Comment #149
berdirNote: The deprecation updates here require 8.8, so that means this is basically blocked on #3042631: Drupal 9 Deprecated Code Report for LinkIt module, which in turn is blocked on the maintainer deciding to drop 8.7 support.
Comment #150
saseedharan commentedIgnore this comment, this was an issue in my local
I am trying to apply the patch #148 to linkit-8.x-5.x-dev, The files are getting added but final status is failed. Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/2020-01-30/linkit_for_link_field-271.... I am using composer to apply patch. Adding patch entry in composer.json and then executing composer install
Comment #151
saseedharan commentedAfter changing the link field to linkit the Max Length & Count down messages were missing from widget settings. After exporting the config it got removed from YML file also. Seems linkit not inheriting properties like Max length & Count down messages from Link field.
Comment #152
primsi commentedNoticed the tel: case is not saved correctly. Not sure though if we should make this more general.
Comment #154
primsi commentedComment #155
dieterholvoet commentedCan I add support for routes? Just returning ''route:" in case the input matches in LinkitHelper::uriFromUserInput. I can post an updated patch.
Comment #156
berdirthis needs to be changed to path_alias.manager for D9 compatibility.
Comment #157
berdirThis will now require 8.8, so should be committed only after #3042631: Drupal 9 Deprecated Code Report for LinkIt module.
@DieterHolvoet: Concerned about this getting bigger and bigger and harder to get committed. Would require test coverage at least.
Comment #158
idebr commentedThe first key in the route parameters is not necessarily the entity parameter. Attached patch adds a sanity check to filter out empty values from the route parameters to increase the likelihood this will return an entity. For example, the Facets Pretty Paths module adds optional route parameters that are empty for
internal:node/12link URIs.Comment #159
paulmartin84 commentedI mentioned the above code previously in #142. Is this code actually needed? It seems to cause lots of problems.
The fix above wouldn't fix the issue I was having. Linking to a view that has a taxonomy term as a named parameter. I fail to see the connection between a route and what entity type the route parameter might be.
Comment #160
idebr commented#159 It is the code path that resolves /node/[node id] links to entity:node/[node id]. Not sure how to solve your specific problem though, you would have to check the code in the default Link widget.
Comment #161
eyilmaz$public_files_dir might be empty here, i.e. when there is an external file system (like s3fs) is used. I guess we should also check for !empty($public_files_dir) in the first condition here.
Comment #162
eyilmazHere is the patch updated which adds the check for empty public file directory.
Comment #163
paulmartin84 commented#160 My issue though is that the code is making a massive assumption that the entity type of the first(or any for that matter) of the routes parameters defines the entity that is being linked to. For a view route, the entity is the view and it is perfectly valid to want to link to a view page. What entity type the views parameters(contextual filters) are shouldn't make any difference.
If I link to a view that has a contextual filter of a taxonomy term. I don't want this changing it to a link to the taxonomy term itself.
Comment #164
eyilmazI noticed that the FieldFormatter does not honour the query params and fragment. Adjusted it to honour that.
Also addressed the issue from @paulmartin84. The entity is only returned, when the route is a canonical route.
Comment #165
bdanin commentedThe patch in #164 worked well enough. However (at least in the Claro theme), the styling of the form with the linkit widget was blowing out the space. The link input field was too wide and pushed the other form elements out of the space. This was used in a paragraph in a node.
Comment #166
lammensj commentedI updated the patch according to the latest dev-release. I mostly removed parts of the patch which were included by Drupal 9 Deprecated Code Report for LinkIt module.
Comment #167
kkri commentedThe patch #166 from @lammensj works well for me in the Seven theme.
I would definitely love to see this feature merged.
Comment #168
rwilson0429 commentedThe patch in #166 works good. Thanks.
Comment #169
primsi commentedAnchors don't seem to work correctly: having #foobar for link would always lead you to the front page#foobar.
Adding a patch. Not sure if this is the correct way to approach this.
Comment #170
primsi commentedDidn't attach the patch...
Comment #171
primsi commentedAdding some test coverage for the latest patch.
Comment #173
alisonPatch works great for me overall!
In my case, the link title field is "required" in my field settings, and after applying the patch and enabling the "LinkIt" widget in the form settings, the red "required" asterisk disappears when I'm on my content editing form. (I think @jesconstantine mentioned this before.)
I think that's the only issue with the patch -- as far as I can tell, anyway. Thank you so much!!
Comment #174
berdirThis fixes notices when a site isn't multilingual, respects the title required setting and fixes some coding standards.
Comment #175
hudriThe latest patch #174 mostly works fine for me.
One issue still not addressed is the media entity file source substituion as reported in #74 and others.
I've been testing a bit, and found something within the stored field value in the database:
Using a multi-cardinality link field (--> guaranteed same field widget),
when I select and save a node, the path
entity:node/123is saved in field_fieldname_uriwhen I select and save a media entity, the path
internal:/media/456is saved in field_fieldname_uriThis does not work with Drupal\linkit\Plugin\Field\FieldFormatter\LinkitFormatter.php
I've changed this function to
and this works for me. Sorry for posting the code here, but I don't know how to create a patch and interdiff.
Comment #176
hudriThis patch fixes the missing "direct link to file"-substitution for media entities by removing the unnecessary check for the
entity:/schema in the field formatter.PS: This is the first time I've created an interdiff and a patch based on another patch, I hope I did get the workflow right, please take it with a grain of salt.
Comment #177
berdirFWIW, if you select a media, it should also use use an entity: URI internally, or some things might not work as expected, e.g. entity_usage tracking. Not sure why it wouldn't, could be related about the back and forth on media urls with/without /edit suffix.
Comment #178
hudriPlease ignore patch #176, of course I forgot something. Recreated the patch again based upon Berdir's patch from #174.
Also keep in mind this patch assumes that media entities have their own canonical URL (
Standalone media URLchecked in/admin/config/media/media-settings). The substitution currently will not work without it. Not sure though if this behavior is good or bad.Comment #179
hudriThere is an issue with stale caches in the field formatter, which becomes especially visible when using media entities with "direct link to file"-substitution. I've added the cache tags of the referenced entity in case of a successful entity substituion.
Comment #180
tbsiqueiraHi, I'm having the following error with this patch:
Error: Call to a member function getMatcherByEntityType() on null in Drupal\linkit\Plugin\Field\FieldFormatter\LinkitFormatter->getSubstitutedUrl()
This started to happen after I updated my drupal from 8.7 to 8.9 version, maybe there was some error that started causing it? I added a check to return null if the $profile variable was null from the Profile::load() function, but I guess this is not solving the root cause? I'm wondering if we are supposed to have profiles set as null?
Is there someone else having the same issue?
EDIT:
The issue is that on Drupal\linkit\Plugin\Field\FieldFormatter\LinkitFormatter::getMatcherByEntityType() the module is trying to load the "default" profile, that I don't have, never had..... don't know why is trying to load the "default" one now. Will continue the investigation.
Comment #181
mortarion commentedHello there,
this is a nice patch. But it seems that it does not cover the support for
<nolink>from the original LinkWidgetUI.See https://www.drupal.org/project/drupal/issues/2698057
Comment #182
hudriThe
LinkitHelperhas an issue when a link is a technically correct entity route, but the entity itself has been deleted. A case like this causes a WSOD with error messageIn this case the surrounding
catch Exceptiondoes not protect us from a plain error, I solved it by simply catching all throwables.Comment #183
berdirI would suggest to instead check explicitly for successfully having loaded an entity. load() is documented to return an entity or NULL, it is an expected situtation. While we are not strictly speaking throwing the exception, https://stackoverflow.com/questions/77127/when-to-throw-an-exception still applies.
Comment #184
hudriIncorporated feedback from #183
Comment #185
bdanin commentedThe patch in #184 worked well for me.
I had to add some logic to my custom.theme, from https://www.drupal.org/forum/support/module-development-and-code-questio... to get the file URL output into .twig, but this worked well.
Comment #186
adinac commentedI've encountered some issues using the latest patch:
1. In the formElement() method of the LinkitWidget class the default url value for the link element is built like this:
$uri_as_url = !empty($uri) ? Url::fromUri($uri)->toString() : '';This allows path processing and the current language prefix and other prefixes, if any (like a country/region prefix), are added to the url and these remain the same on the display page, even when the context changes. I've made the following change:
$uri_as_url = !empty($uri) ? Url::fromUri($uri, ['path_processing' => FALSE])->toString() : '';2. In the getEntityFromUserInput() method of the LinkitHelper class an entity is determined only if the input contains the "entity" scheme. I've made a few changes regarding this as well.
Comment #187
hudri-deleted-
Comment #188
idebr commentedInterdiff for 184 -> 186
Comment #189
richardgaunt commentedI was having problems with the link title field being filled, the selector for $linkTitle depending on a certain structure of form.
I am using a sub-theme of Claro (Gin) which was not working, I've added a more direct way of accessing the title field input.
Comment #191
richardgaunt commentedApologies patch in #189 created incorrectly. Attached new patch and interdiff.
See #189 for details on what has changed.
Comment #192
kasey_mk commentedThe patch in #191 works well for me, once I remembered to set the Linkit profile on each field formatter.
Comment #193
nadavoid commentedThe patch in #191 is working well for me too. This is a great workaround for the core issue of enabling autocomplete of multiple entity types - #2423093: Allow multiple target entity types in the 'entity_autocomplete' Form API element.
Comment #194
godotislateI noticed that in the new field formatter, the cacheable metadata of the substituted URL is not accounted for. It is in the filter
\Drupal\linkit\Plugin\Filter\LinkitFilter::proces()I updated the patch to account for this, and also removed the constructor override to follow this: https://www.drupal.org/core/d8-bc-policy#constructors, similar to how Webform did it: https://www.drupal.org/node/3076421
Comment #195
r_h-l commentedGreat patch but we discovered an issue: encoded characters in the returned autocomplete data.
For instance, a file with a name like "Some Test.file" gets returned from SimpleSuggestion and pasted into the link field as "some/path/Some%20Test.file". When the link field saves, it then further encodes into "some/path/Some%2520Test.file" (to encode the "%"), which then breaks the saved link.
There are two places to alter this, either in SimpleSuggestion (which then makes normal WYSIWYG links out of normal compliance), or someplace in the insertion, which I do not have enough JS experience to tweak and insert a "decodeURI" with a differentiation between when on an entity form vs CKEditor.
Comment #196
nadavoid commentedUpdated patch 194 to make the autofill of the link text optional, configurable on form display.
Comment #197
nadavoid commentedPosting an interdiff between 194 and 196.
Comment #199
nadavoid commentedAdded linkit_auto_link_text to the schema to fix the failing test. Posting a couple more interdiffs.
Comment #201
nadavoid commentedUpdated patch to fix tests
Comment #202
nadavoid commentedComment #205
dylan donkersgoed commentedI've expanded the patch to support route:. Patch and interdiff attached.
I see that a fork has been opened but it does not seem to be up to date with the latest patches. Should we be using that instead?
Comment #206
bdanin commentedEven with the latest patch, I'm still getting an error:
TypeError: Argument 1 passed to Drupal\linkit\SuggestionManager::getSuggestions() must implement interface Drupal\linkit\ProfileInterface, null given, called in /app/docroot/modules/contrib/linkit/src/Controller/AutocompleteController.php on line 79 in Drupal\linkit\SuggestionManager->getSuggestions() (line 28 of /app/docroot/modules/contrib/linkit/src/SuggestionManager.php)This causes linkit to silently fail, and does not provide any suggestions in the field for authors.
And I'm not sure what's causing this yet.
Comment #207
sanduhrsComment #209
bdanin commentedThis new patch in #207 doesn't fix the issue I have in #206.
Comment #210
sanduhrs@bdanin I did not say, that it would solve your problem, did I?
I could have spent some time on declaring why i posted it, though:
The patch in #207 removes the unnecessary linkit-for-link-field-2712951-201.patch file from the patch in #205.
Comment #211
sanduhrsThe attached patch adds a default theme to the field tests to prevent a deprecation notice.
todo: The auto fill title test still fails, because of a missing class in the markup.
Comment #213
peterwegren commented@bdanin, re. #206: You have to explicitly set the Linkit matcher profile in the field display widget settings (including 'Update' and 'Save'). It appears as if the default matcher profile is selected by default, but it isn't saved in those widget settings until you update and save.
If you look in
AutocompleteController.php on line 79, you can see that it is expecting the first parameter to be a Linkit profile:$suggestionCollection = $this->suggestionManager->getSuggestions($this->linkitProfile, mb_strtolower($string));If it is receiving
null, as suggested by your error message, this likely indicates that the widget does not have a matcher profile set.Comment #214
bdanin commented@petorrr, you are correct. This was confusing because when I go to the form view display page, it looked like the default profile was already selected. I figured out how to export the config and it appears to be working for me now.
Comment #215
jlancaster commentedThis is great! #211 works for me cleanly on the 6.x branch and performs the functionality I expected/desired.
Comment #216
cainaruI re-rolled the patch in #211 to resolve the test failure and to address the feedback from #195 regarding double encoding internal links that contain
%20.When a user would enter a link such as
/unencoded%20path%20with%20spaces.pdfinto the link field that used the Linkit widget, save the node, and revisit the node's edit form, the value in the widget would be changed to/unencoded%2520path%2520with%2520spaces.pdf. Save the node again, revisit the node's edit form, and then the value would be/unencoded%252520path%252520with%252520spaces.pdf... This patch leveragesgetUriAsDisplayableStringto address that in the Linkit widget.Disclaimer: There seems to be a bug in core where, in a regular link field, a link with the value of
/unencoded%20path%20with%20spaces.pdfis outputted as/unencoded%2520path%2520with%2520spaces.pdfeven though it is saved correctly in the database as/unencoded%20path%20with%20spaces.pdf(and doesn't change on subsequent node saves). I was able to reproduce this on https://simplytest.me/. This patch does not address that core bug, and I haven't yet found an existing core issue that does.Comment #217
glardup#216 works like a charm!
This is very useful for a commerce site where you want to link to products. I was a bit flabbergasted to find out that core doesn't autocomplete links to other entities than nodes.
Thank you so much for this!
Comment #218
samlerner commentedThe patch in #216 works for me using version 6.0.0-beta1, but there's one caveat: you MUST edit and save the configuration options form for the Link field on the Manage form display page. It's the form opened by clicking the gear in the Link field row. Doing this saves the Linkit profile in the field settings. If you don't do this first, and go to add/edit content and use the Link field, you'll get this lovely error:
Looking at the code, it's calling
$suggestionCollection = $this->suggestionManager->getSuggestions($this->linkitProfile, mb_strtolower($string));and if you haven't saved that profile by saving the config, you get the above error.Comment #219
e5sego commentedThe patch in #216 works for me using version 6.0.0-beta2 too.
Note: I run into the following composer error during import of configuration (drush config:import). I had to clear caches and run the import again.
The "linkit" plugin does not exist. Valid plugin IDs for Drupal\Core\Field\WidgetPluginManager are: datetime_datelist, datetime_default, dynamic_entity_reference_options_buttons, dynamic_entity_reference_options_select, dynamic_entity_reference_default, entity_reference_revisions_autocomplete, file_generic, image_image, link_default, (...)I did not run into error mentioned in #218, but did not tested this much.
Comment #220
mstrelan commented@bdanin @SamLerner what are the steps to reproduce the issue in #206 and #218? Does this only happen when you're upgrading from an old patch to a new patch with an existing LinkIt formatter configured? I was unable reproduce it on a clean installation.
Comment #221
bdanin commented@mstrelan as @SamLerner further points out in #218, you have to go to the form display config, and select the formatter, click save, and then export the configs for linkit. If you do not do this, then you get the error we outline in the logs and the linkit auto-fill silently fails on the edit screen.
Comment #222
mstrelan commented@bdanin on a fresh installation I added a Link field, set the formatter to LinkIt and hit save, no extra step required.
Comment #223
bbombachini+1 this works on 8.x-5.0-beta12 version of the module.
Comment #224
jeffamJust tested on 6.0.0-beta2 and it's a huge improvement over the link field autocomplete from core.
Comment #225
larowlanGreat work here folks, this looks promising. Added a review while I was here
this could use array_map
We can do dependency injection in formatters, so should be doing so given we're already injecting some services
We inject the entity type manager, but are using the singleton to load? Shouldn't we use the entity type manager?
Widgets can do DI, we're doing it in the formatter? Should we do it here too?
this could use some brackets to aid readability
shouldn't we be using data attributes instead of classes for this non-presentational functionality?
Fieldset or details? The comment doesn't match the code here
Same comment here re DI
same comment here re array_map
we could return early here and avoid using elseif
this seems out of scope
This seems out of scope too
Is replacing the generated URL with a hard-coded / the right approach?
This is out of scope here
why not use
listor the new array destructuring syntax here?this should use
hasDefinitionbecause we're not using the returned valuewhat about private files?
shouldn't this use parse_url with the PHP_URL_SCHEME flag instead of a regex?
elseif isn't needed with a return in the previous hunk
in addition, in_array should use the third argument set to TRUE
no need for an else if both previous hunks returned
the entity type is not necessarily the first route parameter
no need to do this every time, can be moved outside the loop
what if prefixes isn't the language negotiation method? ie what if it is done by domain
this feels out of scope, why are we changing dialog tests?
This feels out of scope too, possibly even a regression
Comment #226
cluke009 commentedThis patch is working great for me so far but I did encounter an issue with the node access module.
Probably pretty out of scope at moment but wanted to document it. I will take a deeper look when I get a chance.
Error report below
Drupal\Core\Entity\EntityStorageException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'gid' cannot be null: INSERT INTO {node_access} (nid, langcode, fallback, realm, gid, grant_view, grant_update, grant_delete) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7), (:db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12, :db_insert_placeholder_13, :db_insert_placeholder_14, :db_insert_placeholder_15), (:db_insert_placeholder_16, :db_insert_placeholder_17, :db_insert_placeholder_18, :db_insert_placeholder_19, :db_insert_placeholder_20, :db_insert_placeholder_21, :db_insert_placeholder_22, :db_insert_placeholder_23); Array ( [:db_insert_placeholder_0] => 66251 [:db_insert_placeholder_1] => en [:db_insert_placeholder_2] => 1 [:db_insert_placeholder_3] => nodeaccess_rid [:db_insert_placeholder_4] => 1 [:db_insert_placeholder_5] => 1 [:db_insert_placeholder_6] => 0 [:db_insert_placeholder_7] => 0 [:db_insert_placeholder_8] => 66251 [:db_insert_placeholder_9] => en [:db_insert_placeholder_10] => 1 [:db_insert_placeholder_11] => nodeaccess_rid [:db_insert_placeholder_12] => 2 [:db_insert_placeholder_13] => 1 [:db_insert_placeholder_14] => 0 [:db_insert_placeholder_15] => 0 [:db_insert_placeholder_16] => 66251 [:db_insert_placeholder_17] => en [:db_insert_placeholder_18] => 1 [:db_insert_placeholder_19] => nodeaccess_rid [:db_insert_placeholder_20] => [:db_insert_placeholder_21] => 1 [:db_insert_placeholder_22] => 1 [:db_insert_placeholder_23] => 1 ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 846 of /app/docroot/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).Comment #227
cainaruFor what it's worth, I just noticed that there isn't any validation on the
$element['uri']informElementin/linkit/src/Plugin/Field/FieldWidget/LinkitWidget.php.This means someone can accidentally include a leading space in their link (e.g.,
/my-link-hereorhttps://www.google.com/) and are not warned thatManually entered paths should start with one of the following characters: / ? #.It looks like validation can be added back by doing something like the following:
'#error_no_message' => TRUE,from line 75 inlinkit/src/Plugin/Field/FieldWidget/LinkitWidget.php'#element_validate' => [['\Drupal\link\Plugin\Field\FieldWidget\LinkWidget', 'validateUriElement']],after line 67 inlinkit/src/Plugin/Field/FieldWidget/LinkitWidget.phpNote: Caveat with the above is that, if you are also using the contrib module Media Entity Download and have content creators who tend to enter the download path to the media (e.g.,
/media/1234/download), on node save you'll get an error thatThe path 'internal:/media/1234/download' is invalid.Somewhere along the way inlinkit/src/Utility/LinkitHelper.phpthat media download path is getting turned intointernal:internal:/media/1234/download. I'm hoping I'll have a chance to dig deeper into that soon.Another note: It looks like early iterations of patches in this issue did in fact have uri validation, but it was removed in #113 because of multi-lingual issues. If re-rolling the latest patch to re-introduce uri validation, it might be a good idea to test against multi-lingual links similar to the ones listed in #113?
Comment #228
cluke009 commentedThat is some quality info. Will give me somewhere to start if you don't get to it first.
Comment #229
jeroentFixed some of the feedback in #225.
Still left:
Comment #231
cainaruRe-rolled #229 in hopes of the tests passing.
In this patch, I also re-added validation to the URI element -- as a first pass.
It was very tricky trying to harmonize the various use cases and the URI validation (particularly with files such as
/sites/default/files/2021-07/my-uploaded-document.pdf, internal paths such as/media/1234/download, links such asmailto:name@example.comortel:1-315-867-5309,<front>, etc.). It could use additional improvement from someone who has more insight in the plethora of link-related use cases, as I'm not sure if I might have missed any.Comment #232
cainaruComment #233
philltran commented@cainaru Thank you for your latest patch. I am glad it passed the automated testing.
So far my quick test is working to reference a media entity by manually entering the internal media url. Autocomplete is not searching for the media title. I am not sure if that is intended to work.
Comment #234
jeroentCreated #3223781: Add Support for <nolink> so the NoLinkMatcher can be removed from this patch.
Comment #235
cainaru@philltran autocomplete for media should work as long as you've got Media among your matchers (go to
/admin/config/content/linkit/manage/<name of whatever linkit profile you are using>/matchersto check)Comment #236
philltran commented@cainaru Thank you for your comment. It was an issue on my end.
I re-rolled patch without NoLinkMatcher per @JeroenT's comment and review in comment #225
Do we still need to perform the tasks still left from review in comment #225
Comment #237
jeroentOk, so I went through the tasks from #2712951-235: Linkit for Link field again:
Still left:
Comment #239
jeroentComment #241
jeroentComment #243
jeroentComment #244
adrian83 commentedA few days ago I applied patch 231 to Drupal 8.9.14 which gave us autocomplete matching for taxonomy terms and nodes, exactly what we needed.
Comment #245
bernardm28 commentedIt would be great getting this patch to work with 9.2. However, I'm not sure what's up with that error.
PHP Fatal error: Uncaught TypeError: Return value of Drupal\Composer\Composer::ensureComposerVersion() must be an instance of Drupal\Composer\void, none returned in /var/www/html/composer/Composer.php:96
Stack trace:
Comment #246
bernardm28 commentedThis patch worked on ddev with Drupal core 9.2.4. It seems like that error above has to do with
https://www.drupal.org/project/drupal/issues/3126566 which is merged. So idk why that would trigger an error but it does.
Comment #247
betoaveigaHey @tbsiqueira, I was having the same issue with the patch from #243 applied.
Error: Call to a member function getMatcherByEntityType() on null in Drupal\linkit\Plugin\Field\FieldFormatter\LinkitFormatter->getSubstitutedUrl()This issue was happening when running tests on CI, while cron was executed, so it is difficult for me to find why it is happening.
I fixed it by returning NULL when no profile was available.
My site looks normal, and all tests are passing.
I updated the mentioned patch.
Comment #248
niles38 commented@BetoAveiga Your patch worked well for me. Thank you all for your work on this. I'm looking forward to this functionality being part of Linkit!
Edit: I'm running Drupal 9.2.4.
Comment #249
sachbearbeiter commented@BetoAveiga and @JeroenT
Thanks a lot for the work ...
I'm looking forward ;)
Comment #250
niles38 commentedThis patch does work.
Comment #251
ac#247 works well
Comment #252
jeroentIt seems that the patch in #247 removed some changes that were made in #243.
So I created a new patch, based on #243 and added the same check.
There was also still some feedback left from #235:
Comment #254
jeroentComment #255
tessa bakkerThe required title validation of a required link field isn't displayed.
This is because of the following line of code in the title element:
When removed the required message is displayed for title field.
The
validateTitleElementcallback is only there for an optional link field with a required title if the url is set. Not for validating a required title on a required link field.The image will explain how the core link widget works with a required title validation
Comment #256
tessa bakkerRemoved the line as suggested in comment #255
Comment #257
laura.gatesAny way to get this patch for linkit v6.0.0-beta-3?
Comment #258
kevin.pfeifer commented@laura.gates The patch from #256 is applicable to 6.0-beta3 as well!
I just applied it, cleared cache and it works!
Comment #259
choneyse commentedI just installed this for 6.0-beta3 and the field is working, but I'm not able to get the "Direct URL to media file entity" to work. Regardless of my profile settings, I'm only able to get a link to the media entity. My hope is to be able to link to a PDF that is in the Media Entity as a File.
Comment #260
natemow commented@choneyse re: #259 -- double-check that your entity's field display settings are using the Linkit format.
Comment #261
spadxiii commentedI noticed a strange usage of the ContainerFactoryPluginInterface create method (introduced from #194 onward): here properties were assigned manually to the instance, instead of passing them to the constructor.
Fixed this by re-introducing the constructor again. Also removed the unused EntityTypeManager property in the LinkitFormatter.
Other than that, the patch is the same as in #256.
Comment #263
dieterholvoet commentedThat's intentional, more information here. I suggest changing it back.
Comment #264
spadxiii commentedI made a little mistake with the third_party_settings and label arguments. So here's a new patch:
Comment #265
spadxiii commentedIt feels weird to me to refactor something inside a huge patch without refactoring the rest of the project as well. But then again, refactoring the rest of the project inside a huge patch is also not a good thing to do. I would suggest doing the refactor separately and once that is in, refactor the remaining open patches afterwards.
Besides that, doing it the way it was done in the patch, limits the testability quite a bit. It makes it unnecessarily hard to replace/mock the dependencies. As you can see here, using a public setter method would be better as that allows for more easily mocking the dependencies.
Comment #266
jeroentI don't have a strong opinion on both options.
Anyway, The patch in #264 still needs work since the tests are failing and contains some interdiff files, which should be removed or patch #256 should be used.
Comment #267
spadxiii commentedOh whoops, forgot to remove those from my patch. Here's the same patch without the interdiffs.
Not sure why the tests are failing; the error I see seems unrelated to the changes made with this patch.
Comment #268
jeroentI triggered the tests again for patch in #256 and that patch is still green.
So the error does seem related to the changes.
Comment #269
spadxiii commentedI'll have a closer look
Comment #270
spadxiii commentedI found the issue: missed the initialization of the linkitProfileStorage property.
Now the tests should pass again.
Comment #271
andyd328I've moved the version to 6 as #270 also applies and works well on the latest. Many thanks for the patch SpadXIII!
Comment #272
droath commentedI'm currently using the patch in #267, but without switching the field to use the Linkit Widget, the patch already converted the link URL field and provide autocomplete without any configuration changes. Is that what should be expected?
UPDATE: Looks like Drupal core link widget allows searching out of the box, wasn't expecting that. I switched the widget to LinkIt and everything works as expected. Thanks for the patch!
Comment #273
akasake commentedI ran into some deprecation notices while upgrading my site to PHP 8.1.
Here is #270 with some changes to prevent that.
Comment #274
clement.ferrier commentedFixed an issue where LinkitHelper::getEntityFromUserInput() was not properly identifying the entity from route params.
Comment #275
clement.ferrier commentedComment #276
clement.ferrier commentedThe fix from #2981543: Issue when linking to content with ampersands or single quotes in the title is useful if you use the functionality 'Automatically populate link text from entity label'
Comment #277
omnia.ibrahim commentedThere is an issue when we have multiple link fields, all of them starts the searching in the autocomplete:
Comment #278
omnia.ibrahim commentedComment #279
MGHollander commented@omnia.ibrahim. That should be solved by #2925828: Multiple Linkit elements breaks.
Comment #280
aslaymoore commentedTested the patch from #274 on Drupal 9.2.13. Patch works as expected without any issues that I can see; Linkit widget becomes available from the Form Display settings page, and clicking on the settings gear allows me to choose which LinkIt profile I want to use.
+1 for RTBTC
Comment #281
jeroent@azslay, there’s a status for that 😉
Comment #282
norman.lolCan someone with a little bit more insight please add a proper issue description? Coming from #2423093: Allow multiple target entity types in the 'entity_autocomplete' Form API element I had no clue how all this work done here was supposed to solve which exact problem.
Comment #283
omnia.ibrahim commented@MGHollander they are not working together, when I apply both patches there is error applying both together
Comment #284
norman.lolThere is error. What error? When applying the patch? When using the form?
Comment #285
daniel kortePatch #274 does not apply cleanly with the patch from #2925828: Multiple Linkit elements breaks. Both patches modify js/linkit.autocomplete.js around line 168.
Comment #286
seanbAdd support for multi value fields in this patch.
Comment #288
seanbNot sure how the test fails are related to the JS changes I made?
I also just noticed the formElement method in the widget is not calling the parent method. This means any changes / fixes in the LinkWidget will not work for the Linkit widget. In time the changes between the default link widget and linkit widget will become a problem and harder to maintain. We should probably call the parent, and after that only change/add what we actually need.
Comment #289
seanbAttached patch tries to add only the necessary changes to the LinkWidget, which significantly reduces the complexity. I think we should let the default LinkWidget handle as much as possible.
The test fails in #286 seem to be caused by a change in the editor config schema (in /tests/fixtures). Did not yet look at that. Let's see what the tests think.
Comment #291
seanbLet's see if this fixes the tests.
Comment #293
seanbSorry for the noise...
Comment #294
anprok commentedThis patch works fine on my project based on Drupal 9.4.2, it will be cool to get this feature in released version.
Comment #295
hudriI would really appreciate if we could get this patch merged soon.
This issue has 300 comments, a plethora of patches and interdiffs, and adding more and more edge-case-handling won't make it easier to merge it. Improvements can still be made later on, a lot of people are already using this patch in production for years, it is already in a pretty good state.
If we wait until we get a perfect solution, we might never get one at all.
Comment #296
jacobbell84 commentedI'd love to see this merged in as well. It's making large enough changes that it's interfering with other patches that are trying to touch the same files. Be great to get this in so the other patches can be rerolled
Comment #297
anybodyRTBC +1! :)
Comment #298
bramvandenbulcke commentedThis would be a great addition to the link module. I hope it will be added soon.
Comment #299
johns996 commentedAdding another RTBC to the list.
Comment #300
sharique commented+1 for RTBC.
Comment #301
samlerner commentedI've been using this patch on Drupal 9.x sites for 6+ months now, I'm moving this to RTBC.
Comment #302
jedsaet commentedRTBC+1. Would be great if this were merged in.
Comment #303
johnpitcairn commented+1 for a merge from me.Edge cases can be followups given a site has to explicitly switch to using the new widget and formatter.There is also Linkit Field module for those wary of tracking such a large patch, or experiencing patch collisions (ie ckeditor 5 compatibility) - but that needs composer aliasing for linkit 6.x, and patching to fix a missing validate method...
Comment #304
johnpitcairn commentedVersion was changed to 6.x in #271. The patch at #293 fails to apply to current dev.
Comment #305
jeroentComment #306
Ankit.Gupta commentedRerolled the patch #293 with 6.0.x
Comment #307
johnpitcairn commented@Ankit.Gupta: #306 is missing the new files for the field formatter and widget. Note the file size compared to #293...
Comment #308
Ankit.Gupta commentedInterdiff file
Comment #312
bojan_dev commentedI rebased 6.0.x on MR 12, also fixed the "LinkFieldTest", it was failing due link selectors that were based on link wrappers that don't exist on a stark theme.
Comment #313
karlsheaI'll try and dig into it, but the current MR puts internal:/media/x instead of entity:/media/x so direct file URLs don't work again.
Comment #314
karlsheaMy bad, of course right after I post I see further up that "Standalone media URL" MUST be enabled. It is working.
Comment #315
spadxiii commentedI ran into a little issue with paragraphs where one of the paragraphs has a linkit-field. When the user types in an invalid uri and then tries to add a new paragraph-item, an exception is preventing the new paragraph to be added.
One part of the problem is that the add-more button in paragraphs has a limit_validation_errors, so no validation is done or error is shown at all. I tried removing this, but that didn't work properly: it would validate the whole form and show error-messages in a way that's confusing for the user. After a bit of digging, I found that the error is an exception thrown when trying to make an Url-object from the invalid uri. So after adding a try/catch, it works fine :)
I based this change on the patch in #293, as we're still using version 5.x of linkit.
Note that this change also requires a patch in core for the link field widget. (Same change basically): 3340154
Comment #317
mark_fullmerFor folks using this with the 6.0.x branch, the attached patch, which is identical to the Merge Request at hash 3ded22a7, provides LinkIt for the link field for the latest changes (current with the 6.0.0-beta4 release on 5 March 2023, which provides Drupal 10 compatibility and CKEditor5 support).
Comment #318
berdirThe patch doesn't apply with composer due to the removal of the drupal-8 test file in the merge request, that seems unrelated to this issue and that change was not in patches posted before the merge request was created/updated. You might want to double check that there are no other differences.
Comment #319
Bram Linssen commentedThe patch works against the dev branch (dev-6.0.x).
You also can get the diff file from the merge request directly, https://git.drupalcode.org/project/linkit/-/merge_requests/12.diff
Comment #320
berdir6.0.x and beta4 are currently identical. The patch applies with git apply, but it doesn't properly apply with the patch tool.
My point is that the removal of the old database dump doesn't belong in this issue, it is only in the merge request and was not in in the last compete patch in #293. And if that is different, then other things might be different too and that should be verified.
Comment #321
Bram Linssen commentedHi Berdir, I had the same issue as you with my composer update. After replacing the beta release with the dev release in my composer.json the patch did apply with composer.
Comment #322
mark_fullmerIn my testing, the patch in #317 cleanly applies via Composer when requiring either
6.0.xor6.0.0-beta4(they currently point to the same commit hash).As Bram said above, if you were previously requiring
6.0.xin your codebase, you would need to runcomposer update drupal/linkitin order for thecomposer.lockfile to update to the latest hash and then be able to apply the patch.There are two different syntaxes I've seen for marking the removal of a binary file via diff, but as far as I can tell, that removed .gz file for testing is not the culprit here.
Yes, Berdir makes a good clarification: that the patch in #317 incorporates the latest changes from the MR, rather than a previous patchfile for 6.0.x, since based on this issue history, it looks like that's where active work is happening for 6.0.x. There are differences between the latest patch for 8.x-5.x and the 6.0.x, which I've attached as a diff. To me, it looks like the 6.0.x version is better -- it updates the test logic not to use
assertEqualswhich as of Drupal 10 strips out HTML and instead usesLinkByHrefExists, but folks more familiar with this functionality might better be able to weigh in on the change in LinkitWidget.phpComment #323
mark_fullmerI tend to agree that this "cleanup" is not directly related to this issue and should be left out of the changes for this issue specifically; we can create a separate issue for test cleanup.
Comment #324
mark_fullmerI added #3346274: Remove old test fixture of site install (gzipped file), which only removes the test fixture. Committing that to 6.0.x would require a new patch / updated MR here, but I don't see any reason not to do that.
Comment #325
schiavone commentedThere seems to still be an issue with the #317 patch
Using
ddev composer require 'drupal/linkit:^6.0@beta'I can apply the patch directly by going to the module directory and using
curl https://www.drupal.org/files/issues/2023-03-05/2712951_316.6.x.diff | patch -p1but with an entry in composer.json I get
I re-rolled the patch using a diff from the successfully patch module and it worked.Comment #326
berdir#325 is missing the new files.
I'm really trying to not add even more comments to this very very long issue (judging from the d.o response and render times, it's going to explode at some point), but there really is a composer issue here, although only under some circumstances. Per my output in #320, patch -p1 *can* mostly apply the patch, but it skips the removed binary file. As a result, you have a kinda correctly patched module because whether or not the file is removed is not relevant to the functionality. But it sets the exit code to 1, meaning an error. *If* composer-patches is configured to abort if a patch fails to apply (which is IMHO recommended, otherwise you might deploy your project without some patches), it detects that as an error state and aborts. Also, if you switch between dev and a tagged release and already have a git checkout, composer will just switch your existing git checkout around and not reinstall.
Re #324, if the MR is updated now to not include the file, then it doesn't matter if the other issue is done before or after, it won't conflict anymore.
Comment #327
schiavone commentedCorrecting the patch.Comment #328
schiavone commentedYes @Berdir is correct. The patch does not properly apply due to gz file.
Comment #329
hctomUnfortunately the patch from #327 misses a lot of code (like the field formatter plugin etc.)
Comment #330
mark_fullmerPer Berdir's good suggestion in #326, I've voided the removal of the .gz test fixture; that can be addressed in #3346274: Remove old test fixture of site install (gzipped file).
The merge request is updated an otherwise unchanged compared to the previous commit. The attached patch is a replica of the MR at commit
314cd74, provided so folks don't directly reference the MR diff in Composer.Comment #331
schiavone commentedThank you @markfullmer the diff now successfully patches using composer. Attaching it here for convenience.
Comment #332
proteo commentedJust confirming that the patch applies cleanly, and the functionality it provides works great. Tested on two different sites with Linkit 6.0.0-beta4 and Drupal 9.5.4.
Comment #334
mark_fullmerThe latest change, reflected in last MR commit, only adds PHP coding syntax fixes; I omitted fixes for the changed JS file since it already had syntax violations and didn't want to increase the scope of this issue; those changes can be dealt with subsequently. I did a final manual functional review and everything checked out with the new Linkit field widget/formatter and there were no regressions to the existing CKEditor integration.
I've merged this into the 6.0.x branch, though I would like to leave it there for some time in order to allow for resolution of other issues with patches that might need to be updated, and for community reports of any as-yet undiscovered issues with this implementation. This will be included in the next release. See #3345480: LinkIt Release Roadmap and Issue Prioritization.
Thanks, everyone, for nearly eight years of work on this!
Created: 25 Apr 2016
Committed: 10 Mar 2023
Comment #335
agoradesign commentedthat's really huge! thanks everyone!
Comment #337
inoodle commentedref to https://www.drupal.org/project/linkit/issues/2712951#comment-14956491
There is an issue when linking to content with ampersands or single quotes in the title
A js html decode function added
Comment #338
inoodle commentedAdd in missing new files to 2712951_331_3.6.x.patch
Comment #339
inoodle commentedComment #340
inoodle commentedComment #341
dpi@inoodle, please open a new issue.
The issue has been closed, let's avoid emailing over 200 people over follow ups