Commit 4fb191d0 authored by renatog's avatar renatog Committed by renatog
Browse files

Issue #3268732 by RenatoG: Clear Drupal session when the user concluded the...

Issue #3268732 by RenatoG: Clear Drupal session when the user concluded the confirmation or cancel the request
parent 867c52b3
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -138,6 +138,9 @@ class BlockClassConfirmBulkOperationForm extends ConfirmFormBase {
      }
    }

    // Clear the session because the confirmation is done.
    \Drupal::service('session')->remove('block_class_confirm_bulk_operation');

    \Drupal::messenger()->addStatus($this->t('Bulk operation concluded'));

    // Get path bulk operation.
@@ -162,6 +165,10 @@ class BlockClassConfirmBulkOperationForm extends ConfirmFormBase {
   * {@inheritdoc}
   */
  public function getCancelUrl() {

    // If the user cancel that remove the session and redirect to the bulk operation.
    \Drupal::service('session')->remove('block_class_confirm_bulk_operation');

    return Url::fromRoute('block_class.bulk_operations');
  }