X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fpathauto%2Fpathauto.install;h=4b160ba10148c1c4b1270a66f5c5ff4b61a16080;hb=059867c3f96750652c80f39e44c442a58c2549ee;hp=f8de322f620660f1dae05ccbc426bb8ba3b637d1;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/modules/contrib/pathauto/pathauto.install b/web/modules/contrib/pathauto/pathauto.install index f8de322f6..4b160ba10 100644 --- a/web/modules/contrib/pathauto/pathauto.install +++ b/web/modules/contrib/pathauto/pathauto.install @@ -8,15 +8,13 @@ */ use Drupal\Core\Entity\Entity\EntityFormDisplay; -use Drupal\Core\Plugin\Context\Context; -use Drupal\Core\Plugin\Context\ContextDefinition; use Drupal\pathauto\Entity\PathautoPattern; /** * Implements hook_install(). */ function pathauto_install() { - // Set the weight to 1 + // Set the weight to 1. module_set_weight('pathauto', 1); // Ensure the url_alias table exists. @@ -170,7 +168,8 @@ function pathauto_update_8100() { continue; } - // This is a pattern for a bundle and a language, such as "node_article_es". + // This is a pattern for a bundle and a language, such as + // "node_article_es". $pattern = PathautoPattern::create([ 'id' => $entity_type . '_' . $extracted_bundle . '_' . str_replace('-', '_', $langcode), 'label' => $entity_label . ' ' . $bundle_info[$extracted_bundle]['label'] . ' ' . $language->getName(), @@ -299,3 +298,23 @@ function pathauto_update_8106() { $config->set('enabled_entity_types', ['user']); $config->save(); } + +/** + * Initialize the new safe tokens setting. + */ +function pathauto_update_8107() { + + $safe_tokens = [ + 'alias', + 'alias', + 'path', + 'join-path', + 'login-url', + 'url', + 'url-brief', + ]; + + \Drupal::configFactory()->getEditable('pathauto.settings') + ->set('safe_tokens', $safe_tokens) + ->save(); +}