This patch moves Synonym Collapsing to core. This means that if users type in something that matches a term synonym, Taxonomy suggest to autocomplete with the synonym's base term.

Comments

xano’s picture

Issue tags: -#d7uxsprint +d7uxsprint
dries’s picture

Woot -- this would mean we're finally using synonyms in core.

xano’s picture

StatusFileSize
new4.92 KB

This patch fixes a bug in the query that would pop up when autocompleting a tag string that didn't contain any completed tags yet. It also adds a description to the Synonym textarea in the term form that explains what synonyms do.

oriol_e9g’s picture

Some tests for this functionality could be useful.

xano’s picture

That's not possible, since it's pure JavaScript and the testing framework can't execute that.

Catch mentioned that the backend doesn't apply base terms if their synonyms are entered. This is because there can be terms and synonyms with the same name.

catch’s picture

We could check for term matches, if the word entered matches a term, then save it as the term. If it doesn't, but matches a synonym, save it as the 'parent' term for that synonym. If it doesn't match either, save it as a new term.

xano’s picture

That's what happens now.

catch’s picture

Nope.

Create a term '1'.

Add a synonym 'one'.

/node/add/article

type 'one' into the autocomplete selection.

Save.

You get a new term 'one', not the root term '1' saved.

Getting it to save the term instead of the synonym in that case would also work without javascript, which would be testable.

xano’s picture

Oh, of course. Perhaps it makes to wait until your permissions patch gets in and that we apply this behaviour afterwards? That would mean that this patch could get in before that.

catch’s picture

I don't think permissions make sense for this.

Here's the various scenarios:

1. New word with no matching term or synonym - save a new term.

2. Word matches an existing term, save that term.

3. Word matches a synonym of an existing term, save the term instead.

Permissions would let you stop people doing number #1, but I don't see how it affects #3.

catch’s picture

Status: Needs review » Closed (duplicate)

There's already an issue for this over at #201269: Synonym collapsing in core with more discussion and patches. Marking this as duplicate but let's pick up with the current patch over there.

xano’s picture

Assigned: xano » Unassigned