Problem/motivation

The entity matches allows to filter by bundle.
This filter is not applied for suggestions found by URL.

Steps to reproduce

  1. Create an article (/node/1).
  2. Configure Linkit's entity matcher as such that only content type Page is allowed.
  3. In the autocomplete textfield, ender /node/1
  4. You'll see a suggestion for the article we just created, but we shouldn't because it's content type is not Page

Proposed resolution

Use the bundle filter as well when matching by URL.

CommentFileSizeAuthor
#5 linkit-profile-matchers.png57.8 KBpinesso
#5 create-node.png55.76 KBpinesso

Issue fork linkit-3498711

Command icon 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

rp7 created an issue. See original summary.

rp7’s picture

Status: Active » Needs review
mark_fullmer’s picture

Status: Needs review » Needs work

Good catch. This should definitely be addressed. It looks like the MR is triggering a failure in the tests, right now, with Failed asserting that '' contains "<a href hreflang data-entity-substitution data-entity-type data-entity-uuid title>". -- we'll need to look into that.

pinesso’s picture

StatusFileSize
new55.76 KB
new57.8 KB

I’m also seeing this same issue on the 7.x version.

Not sure if I’m missing something or doing something wrong, but I’ve configured it to accept all bundles except News. However, when I try adding a link using CKEditor, the News content type still shows up in the suggestions.


Any help would be appreciated!

Thank you!

muriqui made their first commit to this issue’s fork.

muriqui’s picture

Version: 6.1.x-dev » 7.x-dev

Updated to 7.x.

muriqui’s picture

Status: Needs work » Needs review
mrshowerman’s picture

I have the same issue in a slightly different scenario, and can confirm that MR!158 fixes it.

Steps to reproduce:

  1. Create two media matchers, one for bundle FOO and one for bundle BAR.
  2. Edit a node and add a link to media entity 1, of type FOO
  3. Edit that link again and click on the link path
  4. Linkit searches for /media/1, and due to the aforementioned bug, both matchers find the entity, where only the first one should
  5. Result: the suggestion is displayed twice

mark_fullmer changed the visibility of the branch 3498711-entity-suggestion-by-url-bundle-filter to hidden.

dave reid made their first commit to this issue’s fork.

mark_fullmer’s picture

Status: Needs review » Fixed

The most recent changes do seem like a good query approach. I functionally tested this and can confirm the fix. Merging!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.