Linkit fails silently and throws an exception if you enable autocompletion on terms and then say you want to limit your query by bundle. This is because we make the assumption that there should be a bundle column in the base table of any entity, which is sadly not true.

Core doesn't have a column matching the actually bundle in taxonomy_term_data, instead it has a vid column which points to the vocabulary table.

I suggest that we convert our bundle names to vids before we do the query for terms to resolve the issue.

Comments

fabsor’s picture

Title: Limiting term autocompletion by bundle doesn't work » Term autocompletion by bundle doesn't work

Better title

anon’s picture

Status: Active » Needs review
StatusFileSize
new2.51 KB

Try this one, do you think we need an update hook for this aswell?

anon’s picture

StatusFileSize
new2.22 KB

Or we could actually reduce that code abit.

fabsor’s picture

Status: Needs review » Needs work

If we do this on buildSettingsForm the vids will be saved in the linkit profile which might be exported. The vids might change if you add more vocabularies and reinstall an installation profile, so this could potentially show different terms than you intended if you add/remove vocabularies.

anon’s picture

Status: Needs work » Needs review
StatusFileSize
new3.56 KB

Yes fabsor, thats correct.

Here is an other patch.

I also included the buildGroup method here, as that also will fail because of the vids.

markusbroman’s picture

Status: Needs review » Reviewed & tested by the community

The patch looks good and the term autocompletion works like a charm

anon’s picture

Status: Reviewed & tested by the community » Fixed

Commited.

Status: Fixed » Closed (fixed)

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