Revisions are not working in Decoupled Router calls using resourceVersion query parameter

Created on 17 February 2023, over 2 years ago

Problem/Motivation

Decoupled Router works well with default revision, but when we request a non-default revision via resourceVersion query parameter, it just continues retrieving the default one.

Steps to reproduce

1. Create a node with several revisions and different titles:
Revision 1 - Title1, published
Revision 2 - Title2, published
Revision 3 - Title3, draft

2. Query the default revision via a call like /jsonapi/node/article/6d4f15d6-d86d-46cf-b958-eaa13768d396
You will see the label "Title2", that's ok.

3. Query the latest revision via a call like /jsonapi/node/page/48e7c00e-9079-4ed6-86a6-e35863954c61?resourceVersion=rel:working-copy
You will see the title "Titile3".

Query the decoupled router for the latest revision via a call like /jsonapi/node/article/6d4f15d6-d86d-46cf-b958-eaa13768d396?resourceVersion=rel:working-copy
You will see the label "Title2", but it should be "Title3".

4. Query the concrete revision via a call like /jsonapi/node/page/48e7c00e-9079-4ed6-86a6-e35863954c61?resourceVersion=id:1
You will see the title "Titile1".

Query the decoupled router for the concrete revision via a call like /jsonapi/node/article/6d4f15d6-d86d-46cf-b958-eaa13768d396?resourceVersion=id:1
You will see the label "Title2", but it should be "Title1".

The resourceVersion query parameter is described here: https://www.drupal.org/docs/core-modules-and-themes/core-modules/jsonapi... โ†’

Proposed resolution

Fix this problem to match the default behavior of Drupal JSON:API with resourceVersion query parameter.

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

๐Ÿ‡ฆ๐Ÿ‡ฒArmenia murz Yerevan, Armenia

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024