Issue #3351750 by benjifisher, Rassoni, smustgrave, larowlan, AaronMcHale:...
Issue #3351750 by benjifisher, Rassoni, smustgrave, larowlan, AaronMcHale: Create BC redirects for children of changed paths
(cherry picked from commit 970abeb4)
* $helper = new PathChangedHelper($route_match, $request);
* $params = [
* '%old_path' => $helper->oldPath(),
* '%new_path' => $helper->newPath(),
* '%change_record' => $change_record,
* ];
* $this->logger->warning('A user was redirected from %old_path. This redirect will be removed in a future version of Drupal. Update links, shortcuts, and bookmarks to use %new_path. See %change_record for more information.', $params);
* $message = $this->t('You have been redirected from %old_path. Update links, shortcuts, and bookmarks to use %new_path.', $params);
* $this->messenger()->addWarning($message);
* return $helper->redirect();
* @endcode
*/
classPathChangedHelper{
/**
* The URL object for the route whose path has changed.
@trigger_error('The path /admin/structure/block/block-content/types is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use /admin/structure/block-content. See https://www.drupal.org/node/3320855.',E_USER_DEPRECATED);
$warning_message=$this->t('You have been redirected from %old_path. Update links, shortcuts, and bookmarks to use %new_path.',$params);
$this->messenger()->addWarning($warning_message);
$this->getLogger('block_content')->warning('A user was redirected from %old_path to %new_path. This redirect will be removed in a future version of Drupal. Update links, shortcuts, and bookmarks to use %new_path. See %change_record for more information.',$params);
$this->getLogger('block_content')->warning('A user was redirected from %old_path. This redirect will be removed in a future version of Drupal. Update links, shortcuts, and bookmarks to use %new_path. See %change_record for more information.',$params);
return$this->redirect($route,[],[],301);
return$helper->redirect();
}
/**
* Provides a redirect to the content block library.
@trigger_error('The path /admin/structure/block/block-content is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use /admin/content/block. See https://www.drupal.org/node/3320855.',E_USER_DEPRECATED);
$warning_message=$this->t('You have been redirected from %old_path. Update links, shortcuts, and bookmarks to use %new_path.',$params);
$this->messenger()->addWarning($warning_message);
$this->getLogger('block_content')
->warning('A user was redirected from %old_path to %new_path. This redirect will be removed in a future version of Drupal. Update links, shortcuts, and bookmarks to use %new_path. See %change_record for more information.',$params);
->warning('A user was redirected from %old_path. This redirect will be removed in a future version of Drupal. Update links, shortcuts, and bookmarks to use %new_path. See %change_record for more information.',$params);
@trigger_error('The path /block/{block_content} is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use /admin/content/block/{block_content}. See https://www.drupal.org/node/2317981.',E_USER_DEPRECATED);
$warning_message=$this->t('You have been redirected from %old_path. Update links, shortcuts, and bookmarks to use %new_path.',$params);
$this->messenger()->addWarning($warning_message);
$this->getLogger('block_content')->warning('A user was redirected from %old_path to %new_path. This redirect will be removed in a future version of Drupal. Update links, shortcuts, and bookmarks to use %new_path. See %change_record for more information.',$params);
@trigger_error('The path /block/{block_content}/delete is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use /admin/content/block/{block_content}/delete. See https://www.drupal.org/node/2317981.',E_USER_DEPRECATED);
@trigger_error('The path /block/{block_content} is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use /admin/content/block/{block_content}. See https://www.drupal.org/node/3320855.',E_USER_DEPRECATED);
$warning_message=$this->t('You have been redirected from %old_path. Update links, shortcuts, and bookmarks to use %new_path.',$params);
$this->messenger()->addWarning($warning_message);
$this->getLogger('block_content')->warning('A user was redirected from %old_path to %new_path. This redirect will be removed in a future version of Drupal. Update links, shortcuts, and bookmarks to use %new_path. See %change_record for more information.',$params);