Get Media entity field values in custom validation handler I am trying to put a custom validation on node form which has paragraph attached to it. The problem is I am not getting paragraph field values available in form_state of my validation handler.

I just see the delta of entites when I do a debug on form_state



As in the screenshot field_asset the entity_reference_revision referencing a media entity, I only see two entities attached in form_state in custom submit handler on node_form but how can I get value of those refernced entities?

Update: I realised it was not paragraph entity but media entity.
Digging the form_state I found the user submitted values for embedded media entites lies at form state storage. My validation code now looks like

/**
 * Implememts hook_form_alter().
 */
function mymodulename_form_alter(&amp;$form, \Drupal \Core\Form\FormStateInterface $form_state, $form_id) {
  $operative_form = array(
    'my_node_add_form',
    'my_node_edit_form'
  );
  if (!in_array($form_id, $operative_form)) {
    return;
  }
  $form['#validate'][] = '_mymodulename_validate_element_node_form';
}

/**
 * Custom validation handler for EDP.
 */
function _mymodulename_validate_element_node_form($form, $form_state) {
  $form_storage = $form_state-&gt;getStorage();
  $form_storage_embed_entities = $form_storage['inline_entity_form'];
  foreach ($form_storage_embed_entities as $key =&gt; $value) {
    $media_entities = $value['entities'];
    foreach ($media_entities as $media_entity) {
      if ($media_entity['entity'] instanceof \Drupal\Core\Entity\EntityInterface) {
        if ($media_entity['entity']-&gt;getEntityTypeId() == 'media') {
          $asset_type[$media_entity['entity']-&gt;field_asset_type-&gt;value] = $media_entity['entity']-&gt;field_asset_type-&gt;value;
        }
      }
      if (count($asset_type) &gt; 1) {
        // early bail.
        break;
      }
    }
    // Validation condition goes here.
    if ($validation_condition) {
      $form_state-&gt;setErrorByName('field_asset', t('Did you try turning it on and off.'));
    }
  }
}