|
|
|
|
@ -327,7 +327,7 @@ function islandora_form_alter(&$form, FormStateInterface $form_state, $form_id)
|
|
|
|
|
|
|
|
|
|
if (in_array($form['#form_id'], $media_add_forms)) { |
|
|
|
|
$params = \Drupal::request()->query->all(); |
|
|
|
|
if (count($params) > 0 && array_key_exists('edit', $params)) { |
|
|
|
|
if (isset($params['edit'])) { |
|
|
|
|
$media_of_nid = $params['edit']['field_media_of']['widget'][0]['target_id']; |
|
|
|
|
$node = \Drupal::entityTypeManager()->getStorage('node')->load($media_of_nid); |
|
|
|
|
if ($node) { |
|
|
|
|
@ -350,7 +350,7 @@ function islandora_field_widget_image_image_form_alter(&$element, $form_state, $
|
|
|
|
|
function islandora_add_default_image_alt_text($element, $form_state, $form) { |
|
|
|
|
if ($element['alt']['#access']) { |
|
|
|
|
$params = \Drupal::request()->query->all(); |
|
|
|
|
if (count($params) > 0 && array_key_exists('edit', $params)) { |
|
|
|
|
if (isset($params['edit'])) { |
|
|
|
|
$media_of_nid = $params['edit']['field_media_of']['widget'][0]['target_id']; |
|
|
|
|
$node = \Drupal::entityTypeManager()->getStorage('node')->load($media_of_nid); |
|
|
|
|
if ($node) { |
|
|
|
|
|