*/
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.
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(),
$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();
+}