Commit 37995324 authored by thalles's avatar thalles Committed by pifagor

Issue #3035662 by thalles, Romixua, oyushchenko, pifagor: Replace usages of...

Issue #3035662 by thalles, Romixua, oyushchenko, pifagor: Replace usages of the deprecated drupal_set_message() function
parent ec3f2338
......@@ -156,7 +156,7 @@ class XmlSitemapEntitiesSettingsForm extends ConfigFormBase implements Container
'entity' => $entity_type_id,
'bundle' => $bundle,
]),
'query' => drupal_get_destination(),
'query' => $this->getDestinationArray(),
],
],
],
......
......@@ -41,7 +41,7 @@ class XmlSitemapLinkBundleSettingsForm extends ConfigFormBase {
if (!$request->isXmlHttpRequest() && $admin_path = xmlsitemap_get_bundle_path($entity, $bundle)) {
// If this is a non-ajax form, redirect to the bundle administration page.
$destination = drupal_get_destination();
$destination = $this->getDestinationArray();
$request->query->remove('destination');
$url = Url::fromUri($admin_path, ['query' => [$destination]]);
return new RedirectResponse($url);
......
......@@ -71,7 +71,7 @@ class XmlSitemapRebuildForm extends ConfigFormBase {
else {
$request->query->set('destination', 'admin/config/search/xmlsitemap');
drupal_set_message(t('A rebuild is not necessary. If you are just wanting to regenerate the XML sitemap files, you can <a href="@link-cron">run cron manually</a>.', [
'@link-cron' => Url::fromRoute('system.run_cron', [], ['query' => drupal_get_destination()]),
'@link-cron' => Url::fromRoute('system.run_cron', [], ['query' => $this->getDestinationArray()]),
]), 'warning');
$this->setRequest($request);
}
......
......@@ -162,7 +162,7 @@ function xmlsitemap_requirements($phase) {
}
else {
$requirements['xmlsitemap_generated']['description'] = $t('The XML cached files are out of date and need to be regenerated. You can <a href="@link-cron">run cron manually</a> to regenerate the sitemap files.', [
'@link-cron' => Url::fromRoute('system.run_cron', [], ['query' => drupal_get_destination()])->toString(),
'@link-cron' => Url::fromRoute('system.run_cron', [], ['query' => \Drupal::destination()->getAsArray()])->toString(),
]);
}
}
......
......@@ -1124,7 +1124,7 @@ function xmlsitemap_form_submit_flag_regenerate(array $form, FormStateInterface
if ($stored_value != 'not_a_variable' && $stored_value != $value) {
\Drupal::state()->set('xmlsitemap_regenerate_needed', TRUE);
drupal_set_message(t('XML sitemap settings have been modified and the files should be regenerated. You can <a href="@run-cron">run cron manually</a> to regenerate the cached files.', [
'@run-cron' => Url::fromRoute('system.run_cron', [], ['query' => drupal_get_destination()])->toString(),
'@run-cron' => Url::fromRoute('system.run_cron', [], ['query' => \Drupal::destination()->getAsArray()])->toString(),
]), 'warning', FALSE);
return;
}
......@@ -1181,7 +1181,7 @@ function xmlsitemap_add_form_link_options(array &$form, $entity, $bundle, $id) {
'#suffix' => '</div>',
'#markup' => t('The default XML sitemap settings for this @bundle can be changed <a href="@link-type">here</a>.', [
'@bundle' => Unicode::strtolower($info['bundle label']),
'@link-type' => Url::fromUri($path, ['query' => drupal_get_destination()])->toString(),
'@link-type' => Url::fromUri($path, ['query' => \Drupal::destination()->getAsArray()])->toString(),
]),
];
}
......@@ -1507,9 +1507,9 @@ function xmlsitemap_run_unprogressive_batch() {
function xmlsitemap_get_operation_link($url, $options = []) {
// @codingStandardsIgnoreEnd
static $destination;
//\Drupal::destination()->getAsArray()
if (!isset($destination)) {
$destination = drupal_get_destination();
$destination = \Drupal::destination()->getAsArray();
}
$link = ['href' => $url] + $options;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment