X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fpathauto%2Fsrc%2FForm%2FPathautoAdminDelete.php;h=277c307008cf6ebcc88b0cb86ffea6e124e8e5ef;hp=a2305252098efc1787b48c83e79e67ee169b8ae4;hb=059867c3f96750652c80f39e44c442a58c2549ee;hpb=f8fc16ae6b862bef59baaad5d051dd37b7ff11b2 diff --git a/web/modules/contrib/pathauto/src/Form/PathautoAdminDelete.php b/web/modules/contrib/pathauto/src/Form/PathautoAdminDelete.php index a23052520..277c30700 100644 --- a/web/modules/contrib/pathauto/src/Form/PathautoAdminDelete.php +++ b/web/modules/contrib/pathauto/src/Form/PathautoAdminDelete.php @@ -133,14 +133,14 @@ class PathautoAdminDelete extends FormBase { } else if ($delete_all) { \Drupal::service('pathauto.alias_storage_helper')->deleteAll(); - drupal_set_message($this->t('All of your path aliases have been deleted.')); + $this->messenger()->addMessage($this->t('All of your path aliases have been deleted.')); } else { $storage_helper = \Drupal::service('pathauto.alias_storage_helper'); foreach (array_keys(array_filter($form_state->getValue(['delete', 'plugins']))) as $id) { $alias_type = $this->aliasTypeManager->createInstance($id); $storage_helper->deleteBySourcePrefix((string) $alias_type->getSourcePrefix()); - drupal_set_message($this->t('All of your %label path aliases have been deleted.', ['%label' => $alias_type->getLabel()])); + $this->messenger()->addMessage($this->t('All of your %label path aliases have been deleted.', ['%label' => $alias_type->getLabel()])); } } } @@ -168,17 +168,25 @@ class PathautoAdminDelete extends FormBase { public static function batchFinished($success, $results, $operations) { if ($success) { if ($results['delete_all']) { - drupal_set_message(t('All of your automatically generated path aliases have been deleted.')); + \Drupal::service('messenger') + ->addMessage(t('All of your automatically generated path aliases have been deleted.')); } else if (isset($results['deletions'])) { foreach (array_values($results['deletions']) as $label) { - drupal_set_message(t('All of your automatically generated %label path aliases have been deleted.', ['%label' => $label])); + \Drupal::service('messenger') + ->addMessage(t('All of your automatically generated %label path aliases have been deleted.', [ + '%label' => $label, + ])); } } } else { $error_operation = reset($operations); - drupal_set_message(t('An error occurred while processing @operation with arguments : @args', array('@operation' => $error_operation[0], '@args' => print_r($error_operation[0], TRUE)))); + \Drupal::service('messenger') + ->addMessage(t('An error occurred while processing @operation with arguments : @args', [ + '@operation' => $error_operation[0], + '@args' => print_r($error_operation[0]), + ])); } }