From 1b66bdbb118cc0b4f1d7d112e416677bee151293 Mon Sep 17 00:00:00 2001 From: Alan Stanley Date: Thu, 16 May 2019 15:30:27 -0300 Subject: [PATCH] Moved check, dropped some debug --- islandora_fits.module | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/islandora_fits.module b/islandora_fits.module index c75b5980..e880a9f2 100644 --- a/islandora_fits.module +++ b/islandora_fits.module @@ -73,11 +73,11 @@ function islandora_fits_theme($existing, $type, $theme, $path) { * Implements hook_ENTITY_TYPE_presave(). */ function islandora_fits_media_presave(MediaInterface $media) { - \Drupal::logger('fits_debug')->notice($media->get('field_complete')->value); - $transformer = \Drupal::getContainer()->get('islandora_fits.transformxml'); if ($media->bundle() != 'fits_technical_metadata') { return; } + + $transformer = \Drupal::getContainer()->get('islandora_fits.transformxml'); $media->set('field_complete', TRUE); $file_id = $media->get('field_media_file')->getValue()[0]['target_id']; $file = File::load($file_id); @@ -95,7 +95,6 @@ function islandora_fits_media_presave(MediaInterface $media) { * Implements hook_media_update(). */ function islandora_fits_media_update(MediaInterface $media) { - \Drupal::logger('fits_debug')->notice('update'); if ($media->bundle() != 'fits_technical_metadata') { return; } @@ -115,7 +114,9 @@ function islandora_fits_media_update(MediaInterface $media) { * Implements hook_media_insert(). */ function islandora_fits_media_insert(MediaInterface $media) { - \Drupal::logger('fits_debug')->notice('insert'); + if ($media->bundle() != 'fits_technical_metadata') { + return; + } islandora_fits_media_update($media); }