Diff compare button not showing

Created on 2 September 2020, almost 4 years ago
Updated 11 April 2024, 3 months ago

Problem: The diff compare button and radio buttons don't show on entities created with Drupal Console after enabling the module

Steps to Reproduce: Create entity with drupal console https://drupalconsole.com/docs/en/commands/generate-entity-content

Additional Info: /admin/config/content/diff/general URL shows all the fields correctly for the custom entities though.

πŸ’¬ Support request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States AlexBorsody

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson

    I believe this is because the module does not currently support anything other than diffs for Node entities. This can be seen by the fact that the diff.routing.yml file is designed around Node entities:

    diff.revisions_diff:
      path: '/node/{node}/revisions/view/{left_revision}/{right_revision}/{filter}'
      defaults:
        _controller: '\Drupal\diff\Controller\NodeRevisionController::compareNodeRevisions'
        _title: Diff General Settings
      requirements:
        _entity_access: 'node.view all revisions'
      options:
        _admin_route: TRUE
    

    I was able to add basic support in my custom entity by:

    1. Adding a routing.yml entry modeled after the one above
    2. Copying the contents of Drupal\diff\Controller\NodeRevisionController into my own controller and refactoring/renaming for my custom entity.
    3. Copying the contents of src/Form/RevisionOverviewForm.php and refactoring/renaming for my custom entity
Production build 0.69.0 2024