diff --git a/audiofix_ror.module b/audiofix_ror.module index f5c6c0b..b5b2636 100644 --- a/audiofix_ror.module +++ b/audiofix_ror.module @@ -1,4 +1,7 @@ bundle() !== 'audio') { // audio e' il nome del nostro paragraph type + if($entity->bundle() !== PARAGRAPH) { // audio e' il nome del nostro paragraph type return; } // campi utili: field_audio_link e field_durata - $link = $entity->get('field_audio_link')->getValue(); + $link = $entity->get(LINKFIELD)->getValue(); if(count($link) == 0) { return; } $link = $link[0]['uri']; if(is_string($link) && isArchive($link)) { $norm = normalizeArchive($link); if($norm !== $link) { \Drupal::logger('audiofix_ror')->notice('Aggiornato da :old a :new', array(":old" => $link, ":new" => $norm)); - $entity->set('field_audio_link', $norm); + $entity->set(LINKFIELD, $norm); } } }