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.

Comments

megachriz’s picture

Maybe 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.

megachriz’s picture

Version: 7.x-2.0-alpha8 » 7.x-2.x-dev
Status: Active » Needs review

Setting the issue to "Needs review", so the testbot will pick up the patch and run automated tests to verify if the patch breaks anything.

Status: Needs review » Needs work

The last submitted patch, taxonomy.inc_.patch, failed testing.

twistor’s picture

Category: Feature request » Bug report
Status: Needs work » Needs review
StatusFileSize
new1.15 KB

  • twistor committed 88f5712 on 7.x-2.x
    Issue #2379915 by hydrant-mark, twistor: Taxonomy Mapper: Assumes there...
twistor’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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