You are here

function robotstxt_update_8101 in RobotsTxt 8

Rename menu path '/filter/tips/' to 'filter/tips'.

File

./robotstxt.install, line 67
Install, update and uninstall functions for the robotstxt module.

Code

function robotstxt_update_8101() {
  $config = \Drupal::configFactory()
    ->getEditable('robotstxt.settings');
  $robotstxt = $config
    ->get('content');
  $robotstxt = str_replace('Disallow: /filter/tips/', 'Disallow: /filter/tips', $robotstxt);
  $robotstxt = str_replace('Disallow: /index.php/filter/tips/', 'Disallow: /index.php/filter/tips', $robotstxt);
  $config
    ->set('content', $robotstxt)
    ->save();
  return t("Renamed path '/filter/tips/' to 'filter/tips'.");
}