Loading src/Form/EntityRecycleDeleteForm.php +6 −5 Original line number Diff line number Diff line Loading @@ -81,8 +81,9 @@ class EntityRecycleDeleteForm extends FormBase { // Get entity delete form. $form = $this->entityFormBuilder->getForm($entity, 'delete'); if ($entity->hasField('recycle_bin')) { $recycleBinField = $entity->get(EntityRecycleManager::RECYCLE_BIN_FIELD)->value; } // Alter form titles. if ($recycleBinField) { $deletePermission = $this->currentUser() Loading Loading @@ -147,7 +148,7 @@ class EntityRecycleDeleteForm extends FormBase { // If already in recycle bin, // delete in permanently. if ($inRecycleBin) { if ($inRecycleBin || !($entity->hasField('recycle_bin'))) { $this->moduleHandler->invokeAll('recycle_bin_entity_pre_delete', [&$entity]); $entity->delete(); $this->moduleHandler->invokeAll('recycle_bin_entity_deleted'); Loading src/Form/EntityRecycleSettingsForm.php +12 −0 Original line number Diff line number Diff line Loading @@ -203,6 +203,18 @@ class EntityRecycleSettingsForm extends ConfigFormBase { $savedTypes = $this->entityRecycleManager->getSetting('types'); $submittedTypes = $this->getSubmittedTypes($form_state); // Select all bundles on which to enable entity recycle bin if nothing is selected. foreach ($submittedTypes as $entityType => $bundles) { if (empty($submittedTypes[$entityType])) { $allBundles = $form_state->getValue('general')[$entityType]['bundles']; foreach ($allBundles as $bundle => $value) { $value = $bundle; $allBundles[$bundle] = $value; } $submittedTypes[$entityType] = $allBundles; } } // Remove any existing fields. foreach ($submittedTypes as $entityTypeId => $bundles) { if (!in_array($entityTypeId, $savedTypes) && !is_array($bundles)) { Loading Loading
src/Form/EntityRecycleDeleteForm.php +6 −5 Original line number Diff line number Diff line Loading @@ -81,8 +81,9 @@ class EntityRecycleDeleteForm extends FormBase { // Get entity delete form. $form = $this->entityFormBuilder->getForm($entity, 'delete'); if ($entity->hasField('recycle_bin')) { $recycleBinField = $entity->get(EntityRecycleManager::RECYCLE_BIN_FIELD)->value; } // Alter form titles. if ($recycleBinField) { $deletePermission = $this->currentUser() Loading Loading @@ -147,7 +148,7 @@ class EntityRecycleDeleteForm extends FormBase { // If already in recycle bin, // delete in permanently. if ($inRecycleBin) { if ($inRecycleBin || !($entity->hasField('recycle_bin'))) { $this->moduleHandler->invokeAll('recycle_bin_entity_pre_delete', [&$entity]); $entity->delete(); $this->moduleHandler->invokeAll('recycle_bin_entity_deleted'); Loading
src/Form/EntityRecycleSettingsForm.php +12 −0 Original line number Diff line number Diff line Loading @@ -203,6 +203,18 @@ class EntityRecycleSettingsForm extends ConfigFormBase { $savedTypes = $this->entityRecycleManager->getSetting('types'); $submittedTypes = $this->getSubmittedTypes($form_state); // Select all bundles on which to enable entity recycle bin if nothing is selected. foreach ($submittedTypes as $entityType => $bundles) { if (empty($submittedTypes[$entityType])) { $allBundles = $form_state->getValue('general')[$entityType]['bundles']; foreach ($allBundles as $bundle => $value) { $value = $bundle; $allBundles[$bundle] = $value; } $submittedTypes[$entityType] = $allBundles; } } // Remove any existing fields. foreach ($submittedTypes as $entityTypeId => $bundles) { if (!in_array($entityTypeId, $savedTypes) && !is_array($bundles)) { Loading