Consider showing all revisions on the revision overview

Created on 10 May 2016, over 9 years ago
Updated 15 May 2024, over 1 year ago

Problem/Motivation

#2713587: NodeController::revisionOverview() shows no revisions if node has no translation for current language โ†’ brought up again that we have a conflict between trying to show only translation-relevant content in places like admin listings, vs. showing people the full history of nodes. This is also a conflict between trying to maintain the original UX of translation sets from 6/7 vs. the field translation approach.

Overall I think the revision tab should show all edits to a node regardless of affected language. For example how else would you undo adding a translation except reverting to the revision just before? We could then have a per-language filter on the page to show only affected languages. Or two tab

Proposed resolution

1. Status quo
2. Show all revisions
3. Have an 'all revisions' tab
4. Show all revisions but have the option to filter by language

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ“Œ Task
Status

Active

Version

11.0 ๐Ÿ”ฅ

Component
Node systemย  โ†’

Last updated 10 days ago

No maintainer
Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

  • Needs screenshots

    The change alters the user interface, so before and after screenshots should be added to document the UI change. Make sure to capture the relevant region only. Use a tool such as Aviary on Windows or Skitch on Mac OS X.

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.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada Liam Morland Ontario, CA ๐Ÿ‡จ๐Ÿ‡ฆ

    Another related problem at would be solved by this: The paging is done in NodeController::getRevisionIds(); that returns 50 revisions at a time. Then in ::revisionOverview(), some of the revisions may be skipped. This can result in an empty results page. I've seen a pager with several pages, but only two revisions that actually appear anywhere.

  • Status changed to Postponed: needs info 6 months ago
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia acbramley

    Is this something we still can/want to/should consider?

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    I think we should do this.

    A language selector would allow for a closer equivalent to the current behaviour for people that need it, but the page just does not properly work as it currently is, so I think we could open a separate issue to add that, and keep things simple here.

  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia acbramley

    Added related/dupe issues for core and Diff. I think the main issue here is the isRevisionTranslationAffected check.

    The generic revision UI also has this same check in VersionHistoryController::loadRevisions. Whatever fix we do for Node should apply there too.

    Agreed that we should keep this one simple and potentially add a language filter in another issue if needed.

  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia acbramley

    After debugging this more it's clear that the current code is definitely masking some pretty weird issues.

    E.g set up the following:
    1. Install standard
    2. Install content_translation module
    3. Add another language (e.g Dutch)
    4. Edit Basic page content type and mark it translatable
    5. Create a node, then translate it to the new language, adding a revision log of "create LANGUAGE revision".

    At this point this will create 2 new revisions - one for English and one for Dutch. The English one will be marked with revision_translation_affected = NULL
    The node_revision table will have 2 records, but node_field_revision will have 3. 2 of those will be for vid 2, one for each language. Vid 2 for english will have values copied from vid 1 (i.e created/changed dates).
    Since the revision_log field is not translateable, the node_revision table will have "create LANGUAGE revision" for vid 2, which is the default revision for english.

    6. Go to node/1/revisions (i.e the English revisions page). You'll see 1 revision marked as current, but this is actually revision 1. You won't see a revision log message, which IMO is incorrect. The reason this is incorrectly shown as the current revision is because of this code:

            // We treat also the latest translation-affecting revision as current
            // revision, if it was the default revision, as its values for the
            // current language will be the same of the current default revision in
            // this case.
            $is_current_revision = $revision->isDefaultRevision() || (!$current_revision_displayed && $revision->wasDefaultRevision());
    
  • Pipeline finished with Failed
    4 months ago
    Total: 723s
    #509843
  • Pipeline finished with Failed
    4 months ago
    Total: 737s
    #509863
  • Pipeline finished with Success
    4 months ago
    Total: 1256s
    #509905
  • Status changed to Needs review 4 months ago
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia acbramley

    This is green now.

    Want to get a review on the code changes before going ahead with a full IS update + CR.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Can the summary be updated with whatโ€™s being proposed? Do we want a page with all revisions loaded? What if itโ€™s 1000s of revisions

  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia acbramley

    @smustgrave did you see #29?

    Do we want a page with all revisions loaded

    No, we still paginate revisions.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Yea but without a clear summary hard to review the code as it wasnโ€™t clear what the we being accomplished

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Any recommended way for testing this one?

  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia acbramley

    @smustgrave it's a bit tricky because you have to generate revisions that are marked as non translation affecting.

    The easiest way to do that is programatically generate some revisions similar to the tests.

  • Pipeline finished with Success
    3 months ago
    #535632
  • Status changed to RTBC 26 days ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Ran test-only feature

    1) Drupal\Tests\node\Functional\NodeRevisionsUiTest::testNodeRevisionsTabWithDefaultRevision
    Behat\Mink\Exception\ExpectationException: 2 elements matching css ".node-revision-table tbody tr" found on the page, but should be 5.
    /builds/issue/drupal-2722307/vendor/behat/mink/src/WebAssert.php:888
    /builds/issue/drupal-2722307/vendor/behat/mink/src/WebAssert.php:441
    /builds/issue/drupal-2722307/core/modules/node/tests/src/Functional/NodeRevisionsUiTest.php:176
    FAILURES!
    Tests: 4, Assertions: 40, Failures: 1, PHPUnit Deprecations: 10.
    Exiting with EXIT_CODE=1
    

    Tried to do the same as the tests manually but ended up borking it so going to lean on the test coverage here.

    But overall believe this one is good and don't see any open items for it. Going to mark.

  • Pipeline finished with Success
    about 21 hours ago
    Total: 737s
    #601686
  • Pipeline finished with Failed
    about 21 hours ago
    Total: 157s
    #601699
  • Pipeline finished with Success
    about 21 hours ago
    Total: 617s
    #601709
  • Pipeline finished with Success
    about 15 hours ago
    Total: 732s
    #601829
  • Pipeline finished with Success
    about 14 hours ago
    Total: 429s
    #601844
  • Pipeline finished with Success
    about 13 hours ago
    Total: 737s
    #601862
Production build 0.71.5 2024