[Meta] Offer a revisions tab for all entities

Created on 15 March 2015, almost 10 years ago
Updated 28 October 2024, 3 months ago

Problem/Motivation

Diff alters the revision tab of nodes to improve the UI.
It also tries to be entity generic so all fields can be configured in its diff behavior.

However, only the node has a revision tab. This tab is provided by NodeController.
For Drupal 8.0, this will not change.

If now every single entity providing modules is required to offer an own revisions tab, things will get ugly.
The tabs will be inconsistent and missing with most entity types.

Proposed resolution

If diff wants to provide a nice revision experience, we should
- Make diff offer a revisions tab if not yet present
- Create a core followup issue to add a revisions tab to all revisionnable entities

Remaining tasks

Decide about release target. Pushing to major since i understood we want to be entity general and not node centric.

User interface changes

API changes

✨ Feature request
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡¨πŸ‡­Switzerland miro_dietiker Switzerland

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

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

  • First commit to issue fork.
  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Rerolled #21 and moved to an MR
    Hiding patches

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    larowlan β†’ changed the visibility of the branch 2452523-meta-offer-a to hidden.

  • Merge request !112Generic revision UI support β†’ (Open) created by larowlan
  • Pipeline finished with Failed
    3 months ago
    Total: 240s
    #322516
  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Updating title to reflect this isn't a meta, there's code.

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10
  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10
  • Pipeline finished with Failed
    3 months ago
    Total: 212s
    #325527
  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Will continue with tests tomorrow

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Updated issue summary
    This now includes tests and is ready for review
    Testing on a client project its working nice πŸ™Œ

  • Pipeline finished with Failed
    3 months ago
    Total: 864s
    #326422
  • πŸ‡©πŸ‡ͺGermany hctom

    I just tested out the issue fork and it works like a charm - only found a problem with custom block content entities. The revision overview seems to work as expected (with the radio buttons to compare selected revisions), but when clicking Compare selected revisions, I get this error:

    Drupal\Core\Entity\Exception\UndefinedLinkTemplateException: No link template 'revision' found for the 'block_content' entity type in Drupal\Core\Entity\EntityBase->toUrl() (line 211 of core/lib/Drupal/Core/Entity/EntityBase.php).

  • πŸ‡¦πŸ‡ΊAustralia mstrelan

    This looks great, thanks to everyone who worked on it.

    @larowlan do you think we should add a test case for media revisions as well, so all core entity types with the generic revision UI are supported?

    @hctom can you provide more info about your Drupal version and any other steps to reproduce it? The test coverage suggests that block content is working so perhaps you have a patch or custom/contrib module that is interfering?

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Can do for media
    I did have that issue with block content before one of the later pushes, so perhaps @hctom was testing an earlier version.
    I fixed it whilst adding the tests.

  • Pipeline finished with Failed
    3 months ago
    Total: 234s
    #328440
  • πŸ‡©πŸ‡ͺGermany hctom

    I used the latest patch on a Drupal 10.3.6 install with nothing fancy in there. It's just a block content entity bundle with a custom bundle class.
    I also updated the patch with the latest changes now, but the errors persists - and as far as I see, the tests do not show any problems, because they only test the revision overview currently and not the actual revision comparison, where this error occurres.

  • Pipeline finished with Failed
    3 months ago
    Total: 260s
    #329719
  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    I was able to reproduce @hctom's results
    Expanded the tests and fixed the issue

    Back to needs review

  • Pipeline finished with Failed
    3 months ago
    Total: 354s
    #330670
  • πŸ‡©πŸ‡ͺGermany hctom

    Just checked the new changes by larowlan and I can confirm: comparing revisions of block content entities is now working as expected. Thank you!

  • πŸ‡¦πŸ‡ΊAustralia acbramley

    Rebase is failing tests

  • Status changed to Needs review 18 days ago
  • πŸ‡¦πŸ‡ΊAustralia acbramley

    Back to green, would be good to get another review on this

Production build 0.71.5 2024