Browse Source

Fix invalid offset error.

8.x-1.x 8.x-1.0-beta10
Alexander O'Neill 3 years ago
parent
commit
c880715b06
  1. 4
      media_attribution.module

4
media_attribution.module

@ -107,10 +107,10 @@ function media_attribution_preprocess_entity_embed_container(&$variables) {
$attribution = $attributions[0];
$author = $attribution->get('field_attribution_author')->getValue()[0];
$source = $attribution->get('field_attribution_source')->getValue()[0];
$source = $attribution->get('field_attribution_source')->count() > 0 ? $attribution->get('field_attribution_source')->getValue()[0] : '';
$license = $attribution->get('field_license')->entity;
$license_link = !empty($license) ? $license->get('field_license_link')->getValue()[0] : FALSE;
$attribution_note = $attribution->get('field_attribution_note')->getValue()[0];
$attribution_note = $attribution->get('field_attribution_note')->count() > 0 ? $attribution->get('field_attribution_note')->getValue()[0]: '';
$attribution_text = [];
if (!empty($source['uri'])) {
$attribution_text['source'] = [

Loading…
Cancel
Save