I am trying to set the #access
attribute to FALSE
on a field that is within an unlimited field collection - so it is hidden from users. I am relatively new to Drupal so I'm not sure how to handle this. I tried to use hook_form_alter
and some basic CSS - but I couldn't get either of the solution to work properly because of the unlimited field cardinality.
Here's what worked for one row in the field collection in a custom module:
$form['field_my_field_collection']['und'][0]['field_myfield']['#access'] = FALSE;
How do you alter a specific field in a field collection with unlimited values? Thanks in advance for any help - the Drupal community is awesome.