This is my 2nd question about my problem, the last was "Users have access to add Commerce Products into the Store and publish it. How to display to user only allowed firms in the product addition form?" I am writing my 6th module and I do not know nothing about form fields arrays. I need to display in node addition form only user referenced terms in field Firms. Taxonomy "Firms" has field_seller of type Entity Reference. I add to all Firms terms users that must have access to them. How can I display to user only those terms that have reference to this user when he add node Product ? I've made this code that has only correct name (I've checked this with other funcions that was in it and worked):
/* Displays only terms that have Entity Reference field with current user reference */ function user_referenced_taxonomy_terms_form_node_form_alter(&$form, &$form_state, $form_id) { //$form['field_firm'] } how to get array $form['field_firm'] of terms that have reference to current user if the user role is not admin?