Commit 1f365c93 authored by Ide Braakman's avatar Ide Braakman Committed by Sascha Grossenbacher
Browse files

Issue #2958704 by idebr, nkoporec, thalles, Prashant.c: Replace usages of the...

Issue #2958704 by idebr, nkoporec, thalles, Prashant.c: Replace usages of the deprecated drupal_set_message() function
parent a4d28786
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ class Fix404IgnoreController extends ControllerBase {
    if (empty($ignored_paths) || !strpos($path, $ignored_paths)) {
      $this->redirectStorage->resolveLogRequest($path, $langcode);

      drupal_set_message($this->t('Resolved the path %path in the database. Please check the ignored list and save the settings.', [
      $this->messenger()->addMessage($this->t('Resolved the path %path in the database. Please check the ignored list and save the settings.', [
        '%path' => $path,
      ]));
    }
+1 −1
Original line number Diff line number Diff line
@@ -169,7 +169,7 @@ class Fix404RedirectUITest extends Redirect404TestBase {
    $this->drupalPostForm(NULL, $edit, 'Save configuration');
    // Should redirect to 'Fix 404'. Check the 404 entry is not shown anymore.
    $this->assertUrl('admin/config/search/redirect/404');
    $this->assertText('Configuration was saved.');
    $this->assertText('The configuration options have been saved.');
    $this->assertNoText('node/' . $node2->id() . '/test');
    $this->assertText('There are no 404 errors to fix.');

+1 −1
Original line number Diff line number Diff line
@@ -160,6 +160,6 @@ class RedirectDomainForm extends ConfigFormBase {
    }
    $domain_config->set('domain_redirects', $domain_redirects);
    $domain_config->save();
    drupal_set_message($this->t('The domain redirects have been saved.'));
    $this->messenger()->addMessage($this->t('The domain redirects have been saved.'));
  }
}
+2 −2
Original line number Diff line number Diff line
@@ -165,13 +165,13 @@ function redirect_generate_batch_generate($num, array &$context) {

function redirect_generate_batch_finished($success, $results, $operations) {
  if ($success) {
    drupal_set_message(\Drupal::translation()->formatPlural(count($results), 'One URL redirect created.', '@count URL redirects created.'));
    \Drupal::messenger()->addMessage(\Drupal::translation()->formatPlural(count($results), 'One URL redirect created.', '@count URL redirects created.'));
  }
  else {
    // An error occurred.
    // $operations contains the operations that remained unprocessed.
    $error_operation = reset($operations);
    drupal_set_message(t('An error occurred while processing @operation with arguments : @args', ['@operation' => $error_operation[0], '@args' => print_r($error_operation[0], TRUE)]));
    \Drupal::messenger()->addMessage(t('An error occurred while processing @operation with arguments : @args', ['@operation' => $error_operation[0], '@args' => print_r($error_operation[0], TRUE)]));
  }
}

+1 −0
Original line number Diff line number Diff line
@@ -7,3 +7,4 @@ configure: redirect.settings
dependencies:
 - drupal:link
 - drupal:views
 - drupal:system (>= 8.5)
Loading