The code for the Taxonomy mapper, when attempting to match against the term name, assumes that there will only ever be one matching term.
It most cases, this may be acceptable. However where some kind of access control is being applied to terms, in one recent case we worked on, it would find a matching tid for the name which would fail validation as it wasn't in the list of allowed values that it retrieves.
We tracked this down to the use of Domain Access. After investigating the issue we came up with a fix, that we felt was probably generic, and not tied to our specific use case or specific to Domain Access.
Our changes are in the attached patch file.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | feeds-multiple-possible-terms-2379915-4.patch | 1.15 KB | twistor |
| taxonomy.inc_.patch | 2.08 KB | hiraethmarkb |
Comments
Comment #1
megachrizMaybe a fix for #2379631: field_attach_validate() must be called before programmatic entity saves would also fix this problem? In that issue is suggested that there should happen some validation before saving a node.
Comment #2
megachrizSetting the issue to "Needs review", so the testbot will pick up the patch and run automated tests to verify if the patch breaks anything.
Comment #4
twistor commentedComment #6
twistor commented