Problem/Motivation

JSON:API: As per documentation https://www.drupal.org/docs/core-modules-and-themes/core-modules/jsonapi... JSON:API provides the ability to preview draft revision. We can preview the entity in Draft and Published state using the Version negotiator.
When we are enabling multilingual and creating multiple Draft revisions it doesn't give the correct working copy for each language.

Steps to reproduce

  • Create the node in english language, published the node and then update to Draft state.
  • Add translation of the node in Japanese and keep in Draft state.
  • API for English to view the Draft state: /en/jsonapi/node/page/{{uuid}}?resourceVersion=rel:working-copy
  • API for Japanese to view the Draft state: /ja/jsonapi/node/page/{{uuid}}?resourceVersion=rel:working-copy
  • For ja getting the Draft data, but for english we are getting the published data only not the Draft one.
CommentFileSizeAuthor
#2 jsonapi_revision-3259280-02.patch2.44 KBdishabhadra

Comments

dishabhadra created an issue. See original summary.

dishabhadra’s picture

Status: Active » Needs review
StatusFileSize
new2.44 KB

Created the patch.

Status: Needs review » Needs work

The last submitted patch, 2: jsonapi_revision-3259280-02.patch, failed testing. View results

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

dmitry.korhov’s picture

Looks like we need to add fallbacks logic into working-copy as well.
Issue was addressed in https://www.drupal.org/project/drupal/issues/3299843, please check attached patch.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.