fix(review-workflows): pass locale params to useDocument in StageSelect and AssigneeSelect by bolg55 · Pull Request #26104 · strapi/strapi · GitHub
Skip to content

fix(review-workflows): pass locale params to useDocument in StageSelect and AssigneeSelect#26104

Open
bolg55 wants to merge 1 commit intodevelopfrom
fix/review-workflows-locale-params-stage-assignee-select
Open

fix(review-workflows): pass locale params to useDocument in StageSelect and AssigneeSelect#26104
bolg55 wants to merge 1 commit intodevelopfrom
fix/review-workflows-locale-params-stage-assignee-select

Conversation

@bolg55
Copy link
Copy Markdown

@bolg55 bolg55 commented Apr 23, 2026

What does it do?

StageSelect and AssigneeSelect were calling unstable_useDocument without the query params (which carry the active locale). Because RTK Query uses the full args object as its cache key, a call without params is a separate cache entry from a call with params: { locale: 'fr' } — it makes its own request and gets the default locale's document back.

This change passes params to unstable_useDocument in both components:

unstable_useDocument({ collectionType, model, documentId: id, params }

Why is it needed?

When editing a non-default locale entry with review workflows enabled, the stage and assignee panel reads from a document fetch that has no locale — so it always reflects the default locale's values. After updating the stage or assignee (both mutations already pass params correctly), the cache invalidation triggers a refetch that still omits the locale, so the panel appears unchanged even though the backend was updated correctly.

This aligns unstable_useDocument with the locale already used by useUpdateStageMutation, useUpdateAssigneeMutation, and useGetStagesQuery in those same components.

How to test it?

  1. Enable i18n on a content type that has review workflows assigned.
  2. Create an entry with both a default locale and a non-default locale (e.g. fr).
  3. Switch to the French locale in the content manager edit view and open the Review Workflows panel.
  4. Before: the stage and assignee shown reflect the default locale, not French. Updating the stage appears to have no effect — the panel doesn't change after save.
  5. After: the panel correctly reflects the French locale's stage and assignee, and updates are visible immediately after save.

Related issue(s)/PR(s)

None on file. Happy to open an issue if preferred.

Related to Internal Ticket ID: 7885

…ct and AssigneeSelect

StageSelect and AssigneeSelect were calling unstable_useDocument without
the query params (which carry the active locale). This caused both
components to always fetch and display data from the default locale,
regardless of which locale the editor had open.

As a result, when viewing a non-default locale entry, the displayed
review stage and assignee reflected the default locale's values. After
updating the stage or assignee for a non-default locale, the cache
invalidation triggered a refetch that still omitted the locale param,
so the panel appeared unchanged even though the backend had been
updated correctly.

Passing params to unstable_useDocument aligns the document fetch with
the locale already used by the mutations (useUpdateStageMutation,
useUpdateAssigneeMutation) and the stages query (useGetStagesQuery),
ensuring the panel reads from and reflects the correct locale.
@strapi-cla
Copy link
Copy Markdown

strapi-cla commented Apr 23, 2026

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
contributor-docs Ready Ready Preview, Comment Apr 23, 2026 3:25pm

Request Review

@github-actions github-actions Bot added the community Changes and fixes created by community members label Apr 23, 2026
@dosubot dosubot Bot added pr: fix This PR is fixing a bug source: core:review-workflows Review workflows package labels Apr 23, 2026
@bolg55 bolg55 added flag: EE Issues correlates to internal EE ticket and removed community Changes and fixes created by community members labels Apr 23, 2026
@bolg55 bolg55 modified the milestone: 5.44.0 Apr 23, 2026
@trunk-io
Copy link
Copy Markdown

trunk-io Bot commented Apr 23, 2026

@bolg55 bolg55 requested a review from Marc-Roig April 23, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flag: EE Issues correlates to internal EE ticket pr: fix This PR is fixing a bug source: core:review-workflows Review workflows package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants