I work on custom Entity integration with Revisions diff.

buildRevisionData does next check:
$route_name = $entity_type_id != 'node' ? "entity.$entity_type_id.revisions_diff" : 'entity.node.revision';

But, "entity.$entity_type_id.revisions_diff" route requires additional three params: $left_revision, $right_revision, $filter.

Obviously, it breaks on render. With message:

Some mandatory parameters are missing ("left_revision", "right_revision", "filter") to generate a URL for route "entity.super_order.revisions_diff". in Drupal\Core\Routing\UrlGenerator->doGenerate() (line 180 of core/lib/Drupal/Core/Routing/UrlGenerator.php).

Problem is in next code:

      $revision_link['date'] = [
        '#type' => 'link',
        '#title' => $this->date->format($revision->getRevisionCreationTime(), 'short'),
        '#url' => Url::fromRoute($route_name, [
          $entity_type_id => $revision->id(),
          $entity_type_id . '_revision' => $revision->getRevisionId(),
        ]),
        '#prefix' => '<div class="diff-revision__item diff-revision__item-date">',
        '#suffix' => '</div>',
      ];

Suggestion is to replace
"entity.$entity_type_id.revisions_diff"
with
"entity.$entity_type_id.revision"
route.

Comments

profak created an issue. See original summary.

profak’s picture

Status: Active » Needs review
StatusFileSize
new1.04 KB

Patch attached. Please review.

Status: Needs review » Needs work
profak’s picture

New patch fixes same issue with other plugins.

Test coverage fails even without patch.