From 394c5f699e0d729c0357c9942fc693ec7c553bd8 Mon Sep 17 00:00:00 2001
From: shriram <saravananshriram80@gmail.com>
Date: Tue, 1 Nov 2022 13:08:36 -0300
Subject: [PATCH] check if the entity is a node

---
 islandora.module | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/islandora.module b/islandora.module
index 7f0f424f..ed2b2380 100644
--- a/islandora.module
+++ b/islandora.module
@@ -333,12 +333,11 @@ function islandora_form_alter(&$form, FormStateInterface $form_state, $form_id)
     }
   }
   $form_object = $form_state->getFormObject();
-
   $utils = \Drupal::service('islandora.utils');
 
   if ($form_object instanceof EntityForm) {
     $entity = $form_object->getEntity();
-    if ($utils->isIslandoraType($entity->getEntityTypeId(), $entity->bundle()) && strpos($form['#form_id'], 'delete_form') !== FALSE) {
+    if ($entity->getEntityTypeId() == "node" && $utils->isIslandoraType($entity->getEntityTypeId(), $entity->bundle()) && strpos($form['#form_id'], 'delete_form') !== FALSE) {
       $form['delete_associated_content'] = [
         '#type' => 'checkbox',
         '#title' => t('Delete all associated medias and nodes'),