2

I'm trying to save a field value for a taxonomy term, my value appears in the term array, but the "fields" array is empty. I'm not sure if it's right what I am going to do. You can see everything about my case in the attached screenshot.

enter image description here

  • I don't see what's wrong, everything looks ok. Maybe explain why do you need not empty fields array? I think it is not empty only when you make changes to entity. Hope someone can correct me if I'm wrong. – Trupal Jul 31 '16 at 13:14
0

Yes, as @Trupal said, forget about the internal properties of the term objects, that's internal details that are not relevant to you.

If you want to see what's inside, try $term->toArray() and look at the result of that in your debugger. Or access the field value with $term->field_foo->value.

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.