I created a View of content revisions. We added a field to the view (a taxonomy reference in this case) and selected the "historical data" value (to show the revision value vs the current node value). We also added an Edit link for the node.
When displaying the view we get the following warning:
Warning: assert(): Tokens need to be valid Twig variables. failed in Drupal\views\Plugin\views\PluginBase->viewsTokenReplace() (line 371 of core/modules/views/src/Plugin/views/PluginBase.php).
When debugging this, we discovered the token it is complaining about is "field_category-revision_id". This is not a valid Twig variable because of the "-". In [#2548291] core changed usage of "-" to "__". However, Views still uses a "-" when adding "revision_id" to a field.
Tracked this down to core/modules/views/views.views.inc in views_field_default_views_data() (using 8.5.x core here):
if ($type == EntityStorageInterface::FIELD_LOAD_CURRENT) {
$group = $group_name;
$field_alias = $field_name;
}
else {
$group = t('@group (historical data)', ['@group' => $group_name]);
$field_alias = $field_name . '-revision_id';
}
This needs to be changed to "__revision_id" but not sure what else in core or contrib relies on this.
Closed: duplicate
10.0 β¨
Last updated
The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.