Instead of looping over all fields, we could simplify the flow and use hook_field_widget_multivalue_form_alter() to disable the fields.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

JeroenT created an issue. See original summary.

JeroenT’s picture

Issue summary: View changes
FileSize
9.76 KB

Moved the code from hook_field_widget_form_alter() to hook_field_widget_multivalue_form_alter() so this patch also works for paragraphs.

JeroenT’s picture

Status: Active » Needs review
JeroenT’s picture

Title: Use hook_field_widget_form_alter instead of hook_form_alter to disable the fields. » Use hook_field_widget_multivalue_form_alter instead of hook_form_alter to disable the fields.

  • JeroenT committed 56a5a10 on 8.x-2.x
    Issue #3097677 by JeroenT: Use hook_field_widget_multivalue_form_alter...
JeroenT’s picture

Status: Needs review » Fixed

Committed and pushed to 8.x-2.x.

Status: Fixed » Closed (fixed)

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