- Status changed to Needs review
almost 2 years ago 12:36pm 17 January 2023 - First commit to issue fork.
- Merge request !10Tokens do not and should not return anything if they do not have data. → (Open) created by saidatom
if you have a field which has no value and you are using token for that field then this module will return token machine name
Tokens do not and should not return anything if they do not have data. here is a patch
<?php
diff --git a/master/web/modules/contrib/autotitle/autotitle.module b/master/web/modules/contrib/autotitle/autotitle.module
index 359d4786..00a09578 100644
--- a/master/web/modules/contrib/autotitle/autotitle.module
+++ b/master/web/modules/contrib/autotitle/autotitle.module
@@ -211,7 +211,7 @@ function autotitle_node_presave(EntityInterface $entity) {
}
else {
$title = $node_type->getThirdPartySetting('autotitle', 'fallback_title');
- $title = \Drupal::token()->replace($title, ['node' => $entity]);
+ $title = \Drupal::token()->replace($title, ['node' => $entity], ['sanitize' => FALSE, 'clear' => TRUE]);
}
$entity->setTitle($title);
?>
Active
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.