|
|
@ -85,11 +85,13 @@ function media_attribution_preprocess_field__paragraph__field_attribution_author |
|
|
|
|
|
|
|
|
|
|
|
function media_attribution_preprocess_paragraph__license_attribution__license_attribution(&$variables) { |
|
|
|
function media_attribution_preprocess_paragraph__license_attribution__license_attribution(&$variables) { |
|
|
|
$variables['license_prefix'] = \Drupal::translation()->translate('Licensed under'); |
|
|
|
$variables['license_prefix'] = \Drupal::translation()->translate('Licensed under'); |
|
|
|
|
|
|
|
$items = $variables['elements']['field_license']['#items']; |
|
|
|
|
|
|
|
if (!empty($items)) { |
|
|
|
$referencedEntity = $variables['elements']['field_license']['#items'] |
|
|
|
$referencedEntity = $variables['elements']['field_license']['#items'] |
|
|
|
->first()->get('entity')->getTarget()->getValue(); |
|
|
|
->first()->get('entity')->getTarget()->getValue(); |
|
|
|
|
|
|
|
|
|
|
|
$variables['license_link'] = $referencedEntity->get('field_license_link')->first()->view(); |
|
|
|
$variables['license_link'] = $referencedEntity->get('field_license_link')->first()->view(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|