Closed (duplicate)
Project:
Drupal core
Version:
11.x-dev
Component:
node system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
20 Dec 2018 at 07:11 UTC
Updated:
17 Oct 2025 at 14:01 UTC
Jump to comment: Most recent, Most recent file


Comments
Comment #2
visabhishek commentedI have noticed if I changed the following code in core/modules/node/src/Controller/NodeController.php then everything is fine for me
public function revisionOverview
to
Comment #3
berdirI don't understand what the problem is, please describe what you think is wrong and how it should be.
Comment #4
visabhishek commentedHi Berdir,
The link under the revisions columns and "Current Revision" under the operation column is the same for all pages as you can see in the attached screenshot.
I think "Current Revision" should come on the first page only.
Comment #5
berdirAh, now I get it, you mean different pages of the pager. I missed the page argument in the URL.
Your fix isn't correct though, I think what we likely need is to add an *additional* check instead that excludes page > 0. That would theretically still be breakable if you have so many drafts that the actual current revision is the on the second page, but that seems like a pretty unlikely scenario.
Comment #6
visabhishek commentedAh, right, this solutions will not work when we have so many drafts that the actual current revision is the on the second page. I will check this scenario also and try to introduce a patch.
Comment #7
visabhishek commentedHi Berdir,
I have tried with the above scenario and its working fine, Screenshot is attached with draft pagination.
Comment #11
vodde83 commentedI have this issue as well, and can confirm that the patch does indeed fix it.
I'm curious however, how there's so little feedback as this still seems to be an issue?
It's not just a visual issue, as this issue makes it impossible to revert back to any of those revisions that are displayed incorrectly as 'Current revision' ( as there are no available 'Operations' in that case ).
Comment #12
brunapimenta commentedComment #15
mediabounds commentedThe patch in #7 assumes that the default revision on a node is displayed in the revisions table--but the revisions table filters to only show revisions where the the current translation is affected. This gets caught by the failing test in
NodeRevisionsUiTest.There is an identical bug reported in #3082614: Node revisions: in paged lists, the first revision in any page is always marked as default, but the patch there has the same problem and doesn't fix the issue if translations are enabled.
I'm taking a different approach: to try to determine which revision ID is the current revision ID by querying the database for the latest revision ID for the current langcode that is both a default revision and affects the current translation. Best I could tell, there was no method in the
TranslatableRevisionableStorageInterfaceAPI so I'm having the controller do an additional query to the database to find the revision.Comment #16
mediabounds commentedFixing code style in #15.
Comment #17
mdupontBumped to 9.4.x which is the current development version
Comment #18
mdupontOn the one hand, the patch in #16 does the job, and maybe there's no need to over-engineer it if it's the only use-case in core where we need "Give me the current revision ID for the current translation of an entity".
On the other hand, I'm wondering if we should offer this method for all translatable and revisionable entities and add a
getCurrentRevisionId()toTranslatableRevisionableStorageInterface. It has more side effects in core and contrib code extending it though.Comment #22
ranjith_kumar_k_u commentedComment #23
aarti zikre commentedreviewing this
Comment #24
aarti zikre commentedVerified patch for Drupal 9.5.x dev version
https://www.drupal.org/files/issues/2022-07-15/3021671-22.patch
Testing Steps:
* Install a new Drupal instance
* Created basic page
* Edit it multiple times till pages for revisions not create
Problem:
Each revision page's first content shows current version
Test Result:
Verified that after applying patch only latest version content shows current version not other revision pages first row
Refer SS

Before apply Patch
After Patch

Test Result Pass
Can be move to RTBC
Comment #25
aarti zikre commentedComment #26
dwwThanks for working on this bug!
However, core committers won't commit this (or most any other issue) without test coverage. As a bug, we want to make sure it never regresses as folks make further changes to the relevant code.
So we need:
Thanks / sorry,
-Derek
Comment #27
smustgrave commentedUploaded a test case.
Comment #29
quietone commentedThis needs an issue summary update with, at least, before and after screenshots and proposed resolution.
@aarti zikre, thanks for the testing. When making screenshots put the latest before and after in the Issue Summary because it helps the reviewers and committers.
I ran the test locally and have some suggestions.
Why 75? Can we get the number per page from somewhere and use that?
Since we already have a unique value, can we use $i here and skip making a random string.
$node->setRevisionLogMessage((string) $i);If the revision count is less that the number of revisions per page, these assertions pass. I think there should be an assertion that fails if there are no revisions on page 1.
Comment #30
smustgrave commentedComment #31
smustgrave commentedAddressed issues #29.1,2,3 and updated issue summary
Comment #32
Aamir M commentedComment #33
Aamir M commentedVerified and tested patch #31 on Drupal 9.5.x-dev. Patch applied successfully and looks good to me.
Testing steps:
1. Go to Content
2. Click on + Add content
3. Select a Basic page then enter the title and Save the page
4. Now a new basic page is created. Edit this page again and again until pagination is created
5. Go to the revisions tab and observe the 1st page and 2nd page
6. Current revision is displayed on both page
7. Apply patch
8. Reload the page and observe
9. Now the Current revision is displayed only on the 1st page at the top
Testing Result:
1. After applying the patch the Current revision is displayed only on the 1st page at the top
Can be moved to RTBC
Comment #34
parashram commentedWhile applying comment #16 patch on Drupal v 9.4.3 and PHP 8.0, it's getting fail and composer gives below error:
The error was: Cannot apply patch https://www.drupal.org/files/issues/2022-01-15/3021671-16-determine_curr...
patching file modules/node/src/Controller/NodeController.php
Hunk #1 FAILED at 164.
Hunk #2 succeeded at 182 (offset 1 line).
Hunk #3 succeeded at 302 (offset 2 lines).
1 out of 3 hunks FAILED -- saving rejects to file modules/node/src/Controller/NodeController.php.rej
Do we have any specific patch for drupal version 9.4.3 and PHP 8.0 ? How can we apply this patch for the mentioned setup ?
Comment #35
quietone commented@Aamir M, Welcome to Drupal! Thanks for testing the patch, when the testing includes screenshots they should be added to the issue summary in the user interface section. Thanks
@smustgrave, thanks for the updated patch.
Just some minor things.
The changes made in the patch have not been reviewed and since there were changes made to the test can we have a fail patch.
s/page1/page 1/
I have not reviewed the code or the changes to the test.
Comment #36
smustgrave commentedActually rethinking this one I’m not sure it’s a bug? If the current revision isn’t on every page are you able to compare revisions across pages?
Comment #37
parashram commentedTest patch with Drupal v 9.4.3 and PHP 8.0
Comment #38
smustgrave commented@Parashram can you please upload an interdiff if you are going to submit a patch.
Comment #39
Manibharathi E R commentedPatch #31 Tested on Drupal 9.4.x-dev. Patch applied successfully.


Before the patch
After The Patch
Comment #40
parashram commentedPatch #31 working on Drupal 9.4.3, PHP 8.0
Comment #41
parashram commentedComment #42
smustgrave commentedPatch isn’t passing core tests so testing manually doesn’t count
Comment #43
berdir> Actually rethinking this one I’m not sure it’s a bug? If the current revision isn’t on every page are you able to compare revisions across pages?
FWIW, drupal core doesn't allow you to actually compare versions, that's diff.module which mostly replaces the current core functionality, as there's not really another way. With core, you can just manually compare by viewing the different revisions in separate tabs, that could be done across multiple pages.
That said, I do agree that maybe this needs a UX review. There might be (better?) alternatives to just removing it, maybe show it separately and not in the main list?
Comment #44
berdirThere's also something strange about the screenshots. It still shows 3 revisions on the second page, I would expect one less if it doesn't repeat the current one?
Comment #45
mediabounds commentedThe current problem is that the second page is just labeling the first revision as "current revision" (though it is not). Essentially, the way core currently works is that the second and subsequent pages of revisions will always label the first listed revision as as "current."
So I think there is a discrete bug here that can still be addressed while maybe separately considering UX improvements.
Comment #46
ravi.shankar commentedAdded test only patch and fixed one nit of patch #31 as mentioned in comment #35.
Comment #48
parashram commentedHi All,
Is it working for Drupal 10?
Thanks!
Comment #49
Manibharathi E R commentedPatch #46 Tested on Drupal 9.5.x-dev. Patch applied successfully.


For the Drupal 10 test case is failing. Need to fix the test cases.
Before Patch:
After Patch:
Comment #51
piotrsmykaj commented.
Comment #52
piotrsmykaj commentedRe-roll of #46 against Drupal 10.2.x.
Comment #55
sokru commentedUpdated the issue summary and rebased the MR to 11.x branch. I agree with #45 that doing more complete UX renew should be done on separate issue so we could fix this 6 years old issue first.
Comment #57
smustgrave commented1 test I think we should consider is what if someone wnats to compare current revision with a revision on a 2nd page, will that still be possible.
Comment #58
sokru commentedQuoting @berdir from #43
I assume we don't want to include Diff module into core on this issue, so setting back to Needs review. Diff module uses routeSubscriber so changes in this MR does not have effect on Diff module.
Comment #59
smustgrave commentedComment #60
sokru commentedFeedback has been addressed.
Comment #61
smustgrave commentedAll feedback appears to be addressed.
Comment #62
quietone commentedIn #43 a UX review was asked for and I don't see that. Tagging for a review.
At least one thing that will be needed here is up to date screenshot available form the Issue summary. That same would be true for testing results. If they are in the issue summary, then the reviewer can find the correct work to review.
Comment #63
acbramley commentedIs this worth spending time on given this will swap to the generic revision UI in #3153559: Switch Node revision UI to generic UI?
I also noticed other weird behaviour when testing this such as the "Current revision" on the second page shows the revision log message of a different revision.
Comment #64
smustgrave commentedWanted to give 1 more bump for #63
Comment #65
sokru commentedCan confirm that #3153559: Switch Node revision UI to generic UI would make this obsolete.
Comment #67
smustgrave commentedLets close this one as a duplicate then thanks for following up!