Commit 7ea65439 authored by Kevin Paxman's avatar Kevin Paxman
Browse files

Merge branch 'feature/uw_ct_profile-ibiki-readonly-form-fields' into '8.x-1.x'

Feature/uw ct profile ibiki readonly form fields

See merge request !5
parents fe3be55b d861f850
......@@ -19,7 +19,9 @@ function uw_ct_profile_form_node_uw_ct_profile_form_alter(&$form, FormStateInter
'wrapper' => $form['#id'],
if ($form['field_uw_ct_profile_contact']['widget'][0]['target_id']) {
// Apply readonly to fields only when link with contact field has contact
// entity referenced.
if (!empty($form_state->getValue('field_uw_ct_profile_contact')[0]['target_id'])) {
foreach (_uw_ct_profile_alter_fields() as $profile_field => $contact_field) {
$form[$profile_field]['widget'][0]['value']['#attributes']['readonly'] = 'readonly';
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment