0

So I've been trying to create a user with an entity reference taxonomy term, however for some reason it doesn't seem to work.

I've noticed that it depends on the widget used, but I've tried every combination of widgets and data, and it doesn't appear to work.

Here's an example of one way:

                    "field_likes": {
                        "und": "1"
                    }

I've also tried this, also for example:

                    "field_likes": {
                        "und": [
                            {
                                "target_id": 1
                            }
                        ]
                    }

Is there anyway to add taxonomy terms as an entity reference on a user that will work? Has this changed, or am I doing something wrong?

0

I was able to get it working with the following on checkboxes and select:

"field_likes": {
"und":{
"target_id": "1"
      }
}

This technically solves the problem, though I'm not sure how to send up multiple values this way.

EDIT:

Here is the actual solution, which not only allows you to put in entity reference taxonomy terms, but multiple as well:

"field_likes": {
                 "und":{
                         "target_id": "1",
                         "target_id_1": "2"
                        }
                }

This is with the select list widget, which I think is important for this particular example (based on other links I've been reading).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.