Problem/Motivation
From #2350939: Implement a generic revision UI, mentioned in summary/96/103/108/109/110.
To reduce duplicate code and maintenance burden, we should aim to rework Node's revision UI so it extends generic entity UI implemented in #2350939: Implement a generic revision UI
A generic revision UI is being implemented in #2350939: Implement a generic revision UI, this issue exists to deprecate/remove Node's revision UI in favor of the generic solution.
Proposed resolution
Remaining tasks
Postponed on #2723579: NodeRouteProvider should extend DefaultHtmlRouteProvider
Replace Node' revision UI code, extending generic revision UI.- Can we remove Node test coverage which already exists for generic revision UI?
- Specific enhancements between generic UI and existing Node UI need to be identified, and add tests for this functionality.
- Decide whether to keep yellow highlight, see #23 and linked comments
- Decide how to work with Diff module, which has almost 60k reported installs which would need a update due to this issue
- Out-of-scope:
Move use admin theme out of node and into system. migrate config/schema. update _admin_route setoption in\Drupal\Core\Entity\Routing\RevisionHtmlRouteProvider::getVersionHistoryRouteto use the config value.
User interface changes
Issue aims to replicate existing interface, only removing the yellow background from first row.
Before:

After:strong>

API changes
Class names should be maintained, but extend generic classes.
Format of node render arrays and forms will change.
Data model changes
None?
Release notes snippet
-
| Comment | File | Size | Author |
|---|---|---|---|
| #66 | 3153559-after.png | 88.14 KB | sokru |
| #66 | 3153559-before.png | 90.79 KB | sokru |
Issue fork drupal-3153559
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
aaronmchaleComponent should probably be "node system" in this case, since this issue will primarily impact the node module.
Comment #3
jibranThis is at least postpone by 2 if not 3.
Comment #4
aaronmchaleI believe #2723579: NodeRouteProvider should extend DefaultHtmlRouteProvider could be done in parallel and wouldn't be a hard blocker because #2350939: Implement a generic revision UI provides a separate route provided dedicated to providing revision routes.
Comment #5
jibranYes, but both this issue and #2723579: NodeRouteProvider should extend DefaultHtmlRouteProvider will be deperecating some route defined in
node.routing.ymlwhich mean both issues are blocked on #3159210: Support route aliasing (Symfony 5.4) and allow deprecating the route name.Comment #6
aaronmchaleYep that makes sense. So would that be [PP-3] now or still [PP-2], since yeah technically this issue is postponed on 3 issues, but as you said #2723579: NodeRouteProvider should extend DefaultHtmlRouteProvider depends on #3159210: Support route aliasing (Symfony 5.4) and allow deprecating the route name anyway.
Comment #7
jibranHere is a WIP patch based on #2350939-134: Implement a generic revision UI, #2730631-140: Upcast node and node_revision parameters of node revision routes, #3043321-56: Use generic access API for node and media revision UI and #2723579-94: NodeRouteProvider should extend DefaultHtmlRouteProvider. Not ready for CI testing.
Comment #8
dpiPadded summary.
Comment #9
acbramley commentedHere's a reroll of #7 on top of #2350939: Implement a generic revision UI (patch 134)
Comment #12
aaronmchale#3043321: Use generic access API for node and media revision UI was committed, so this is not longer blocked on that issue; However it should probably be blocked on #3045358: [PP-1] Node module revision permission IDs are too generic.
Comment #13
aaronmchaleThis issue also needs to be resolved first #3159210: Support route aliasing (Symfony 5.4) and allow deprecating the route name, so PP-3.
Comment #14
aaronmchaleSo to summarise, this issue is blocked on:
But it would be nice to also have #2723579: NodeRouteProvider should extend DefaultHtmlRouteProvider done first, not making it a hard blocker though, as the current implementation in #2350939: Implement a generic revision UI uses a separate route provider.
Comment #16
acbramley commentedRerolled #9 on top of #202 of #2350939: Implement a generic revision UI
Comment #17
aaronmchaleThe latest patch in #2350939: Implement a generic revision UI adds this:
We should probably do something about this. I imagine the cleanest way would be to deprecate the
entity.node.version_historylocal task and at the same time deprecate this hook implantation so that they are both removed.Comment #19
dpiComment #21
dpiMR + patch on top of #2350939-268: Implement a generic revision UI #268
Comment #22
pasqualleIs there a rule where to put the RouteProvider class? Core seems to have a mess. Would be nice to unify where these files should go, and use the correct directory in this patch.
should it be
src\Entity\orsrc\Routing\orsrc\Entity\Routing\directory?Comment #23
dpiAdding info from #2350939-261: Implement a generic revision UI + #2350939-277: Implement a generic revision UI re usability review of main entity revision UI issue, especially comparing existing node functionality vs work-in-progress MR. More detail/context is provided these linked comments.
When node to generic UI, we should revisit whether its necessary to retain the yellow background. It was introduced way back in #42072: Rework revisions overview screen, there doesnt seem to be much foundation/rationale for keeping it exactly as is. So we can decide whether to retain/rework/remove, and whether to move the styling to the theme, especially Claro.
We should also port the "Use admin theme" checkbox provided by node to entity generic, in system.module or similar. Specifically, move config schema, migrate existing node config, to system. Then update
\Drupal\Core\Entity\Routing\RevisionHtmlRouteProvider::getVersionHistoryRouteto pull from this config.Comment #24
dpiComment #25
catchComment #26
dpiRebased onto and updated style to match #2350939: Implement a generic revision UI
Comment #27
berdirCan we test what this does to the diff module?
Comment #28
daften commentedSince #2350939: Implement a generic revision UI is fixed, this can be made active again I think.
Comment #29
andypostIt needs a way to deprecate routes, so next blocker is #3159210: Support route aliasing (Symfony 5.4) and allow deprecating the route name
Comment #30
dpi@andypost
My understanding with this is we don't actually need to deprecate routes, we can update the new
NodeRevisionRouteProviderin the MR to use the same route ID's as found in existing node.routing.yml.entity.node.revisionandentity.node.version_historyare fine asRevisionHtmlRouteProviderwill generate the same IDs.However
RevisionHtmlRouteProviderhasentity.$entityTypeId.revision_revert_formandentity.$entityTypeId.revision_delete_formfor the revert and delete routes. Whereas the existing node routes arenode.revision_revert_confirmandnode.revision_delete_confirm.We can override
\Drupal\Core\Entity\Routing\RevisionHtmlRouteProvider::getRouteswith the legacy ID's, and if we really want can deprecate them. But its not really a requirement as far as I can tell.Or is there something else I'm missing?
Comment #31
andypost@dpi thank you! it makes sense but moreover except of routing it needs permission fix so at least one blocker #3045358: [PP-1] Node module revision permission IDs are too generic
the second is more about polishing #2723579: NodeRouteProvider should extend DefaultHtmlRouteProvider
Comment #32
jibranI agree with @dpi let's not add a scope creep of deprecating the routes we can do that in #2723579: NodeRouteProvider should extend DefaultHtmlRouteProvider. Let's keep it a follow up task to #2350939: Implement a generic revision UI.
Comment #33
aaronmchale#3159210: Support route aliasing (Symfony 5.4) and allow deprecating the route name should make deprecating routes possible.
Long-term it would be good if the node module followed the accepted pattern for route names, we could open a follow-up issue to this one and block #2723579: NodeRouteProvider should extend DefaultHtmlRouteProvider on it.
Comment #34
dpiThough we aren't blocked on #2723579: NodeRouteProvider should extend DefaultHtmlRouteProvider as revision provider is a totally different class.
What are we actually postponed on?
Comment #35
andypostpermission providers also separate issue #2809177: Introduce entity permission providers
Comment #36
catchSince it's not clear what exactly is blocking this and what might be done in parallel, going to tentatively unpostpone - then if we do hit a hard blocker we can always re-postpone again.
Comment #37
aaronmchaleAgreed, I was thinking that in this issue we could just keep the route names the same as they are right now, then open a follow-up issue to change all the node route names which don't conform to the standard once #3159210: Support route aliasing (Symfony 5.4) and allow deprecating the route name is done (so not just the revision routes). We could either postpone that follow-up issue on #2723579: NodeRouteProvider should extend DefaultHtmlRouteProvider, or the other way round, or maybe even do them in parallel.
Comment #38
aaronmchaleComment #39
acbramley commentedLatest commit should fix some of the revert failures (although very well may break other things). The local task failures are beyond me, those unit tests are voodoo magic.
Comment #40
smustgrave commentedIn the MR you say that entity.node.version_history is replaced but seems to not be getting picked up?
Comment #41
acbramley commented@smustgrave it is being picked up, the local task unit tests are failing for other reasons. Manually testing the patch shows the revisions route.
Comment #43
acbramley commentedWas not meant to change back to NR - @VladimirAus are you going to be working on this?
Comment #44
acbramley commentedLatest commit should fix the local task tests. The theme handler is needed for the other local task deriver.
Comment #45
vladimiraus@acbramley I'm testing it...
Comment #46
acbramley commentedAwesome! Thanks :)
Comment #47
acbramley commentedPushed along some more failures, generally speaking the Node revision tests are a bit of a mess and there seems to be a lot of duplication across different test classes. I think this is going to take someone that knows the ins and outs of translations and the rest of it to really figure out how we are going to roll this out so it's not so disruptive. The functionality is changing quite a bit.
I've also added a pager to the generic revision UI controller as we were missing that and some of the Node based tests depended on it, I think it's a good idea to add one in any case.
Comment #48
aaronmchaleI wonder if it would be better to do that in a separate issue, along with any changes to the generic implementation to support Node moving to it, then this issue is well scoped to only the changes needed in the Node module itself.
Comment #49
smustgrave commentedFixed a few but still can't figure out what's wrong.
Comment #50
dpiLets get a screenshot comparison of the patch-to-date versus core as-is.
Do we need to deprecate
\Drupal\node\Controller\NodeController::revisionOverviewin some way?Comment #52
sumit saini commented#3374607: Revision UI reverts all language translations when only one language is reverted should be fixed before switching to new revision UI to maintain existing behavior for reverting revisions of node translations.
Comment #53
acbramley commentedAdded #3384725: Add pagination to VersionHistoryController for #48
Comment #54
acbramley commentedBlocked on #3374607: Revision UI reverts all language translations when only one language is reverted
Comment #55
acbramley commentedI'd say this would also be blocked on #3384725: Add pagination to VersionHistoryController
Comment #56
acbramley commentedRe #52 I have marked that postponed, I can't reproduce the issue.
Now I think this is only blocked by #2723579: NodeRouteProvider should extend DefaultHtmlRouteProvider
Comment #57
quietone commentedAdding what this is postponed on to the remaining tasks per Remining tasks.
Comment #58
quietone commentedComment #59
acbramley commentedComment #60
andypostComment #61
amateescu commented#2723579: NodeRouteProvider should extend DefaultHtmlRouteProvider got in, so this is no longer blocked.
Comment #66
sokru commentedI created a new branch & merge request for Drupal 11.x. Basically just a reroll with few changes to legacy routes.
On issue summary:
- Added a remaining task for Diff module. Probably we don't want to remove the routes, but deprecate them, otherwise current Diff module users would face a fatal error on
node/{nid}revisionsroute, due to https://git.drupalcode.org/project/diff/-/blob/2.x/src/Form/RevisionOver...- Marked the "Use the administration theme when editing..." checkbox refactoring as Out-of-scope, since this issue is already rather hard to complete.
- Keeping or removing the yellow background for first row, would need a decision. Since there's no strong argument for keeping it, I'd suggest we remove it (currently on MR).
- Added screenshots with yellow background removal.
Comment #67
smustgrave commentedComment #70
oily commentedFixed PHPCS. Now there are a few tests failing. One is in NodeRevisionsTest.php. It concerns a missing 'revert' button so seems related to the issue. Though looking at the screenshots in the IS does not seem to be any removal of 'revert' buttons going on.
Comment #71
oily commentedRemoved.
Comment #72
smustgrave commented@oily because I get the emails. If you are going to post the test-only run it should also be with a code review please. Just running the test job and posting the results will not result in credit if that's the end goal and I've got a number of emails of just the posting. Again if you see me do 9/10 times I won't get credit either so just FYI
Comment #73
mstrelan commented@oily we don't need the test-only job here, it's only useful for bug reports as it demonstrates the bug existed in HEAD and is fixed in the MR. Also, pasting its output only pollutes the issue and leads to more scrolling. Better to link to the job output if it's relevant.
Comment #74
oily commentedRe: #72 @smustgrave You told me that before and I heard you. As far as credit goes, you can see at #70 that I have already fixed PHPCS and as a result the pipeline has moved forward to the tests and lo ahd behold! several tests are failing. So they need to be fixed. Maybe not a huge amount of progress but progress, nevertheless? Or maybe not? How do I know? If I could wave a magic wand and become an expert contributor overnight with 500 credits not 66 credits, maybe i could contribute more to this issue or do what I do at a faster rate. I have waited 48 hours for @sokru to PHPCS his own work. (another rule I was told about?). I see that test-only was a wrong move,now. But I was trying to do a bit more that just fix PHPCS. I was hoping to fix at least one of the broken tests, too. But the test-only test set me off on the wrong path. Thanks for putting me right on that!
Comment #75
acbramley commentedThe last failure is in NodeRevisionsUiTest::testNodeRevisionsTabWithDefaultRevision due to a behaviour change between the 2 revision overview controllers.
In NodeController::revisionOverview we have this:
Whereas in VersionHistoryController::buildRow we just check
$revision->isDefaultRevision()We need to decide whether we want the behaviour change for Node, or for every other entity type using RevisionHtmlRouteProvider
Comment #76
acbramley commentedtestRevisionTranslationRevertis also failing which uses another node specific revision routenode.revision_revert_translation_confirm.