You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When requesting a Story from a release (using from_release param) which has a resolve relations, the resolved story is not from the requested release but from the default "Current" release. Content from a release cannot be viewed correctly if it contains referenced stories.
Expected Behavior
When fetching a story from a release using the from_release param, resolved relations should be resolved with stories from the same requested release.
When fetching a story from a release using the from_release param, resolved relations are resolved with stories from the default "Current" release.
Storyblok.getStory('my-slug',{
from_release: myReleaseId,
resolve_relations: "myComponent.myField",
});
## Steps to Reproduce
1. Create a story (A) with a reference (Single-Option Field Options: Source: Stories) to another story (B).
2. Create a Release (R) in Storyblok and change some content of story (B) in Release (R)
3. Fetch Story (A) using `getStory` with the `from_release` and `resolve_relations` parameters
4. Story A is correctly returned from the Release (R) but its nested content of Story (B) is the original content from Release (Current) instead of the requested Release (R) in which it has been changed.
## Possible Solution
`src/index.ts`
private async resolveRelations(
//...
for (let chunkIndex = 0; chunkIndex < chunks.length; chunkIndex++) {
const relationsRes = await this.getStories({
per_page: chunkSize,
language: params.language,
version: params.version,
from_release: params.from_release, // Add any user-provided release param sent to the original getStory() request
by_uuids: chunks[chunkIndex].join(','),
excluding_fields: params.excluding_fields,
})
// ...
The same may be required for `resolveLinks()`.
Thanks!
The text was updated successfully, but these errors were encountered:
When requesting a Story from a release (using
from_release
param) which has a resolve relations, the resolved story is not from the requested release but from the default "Current" release. Content from a release cannot be viewed correctly if it contains referenced stories.Expected Behavior
When fetching a story from a release using the
from_release
param, resolved relations should be resolved with stories from the same requested release.Current Behavior
When fetching a story from a release using the
from_release
param, resolved relations are resolved with stories from the default "Current" release.private async resolveRelations(
//...
for (let chunkIndex = 0; chunkIndex < chunks.length; chunkIndex++) {
const relationsRes = await this.getStories({
per_page: chunkSize,
language: params.language,
version: params.version,
from_release: params.from_release, // Add any user-provided release param sent to the original
getStory()
requestby_uuids: chunks[chunkIndex].join(','),
excluding_fields: params.excluding_fields,
})
// ...
The text was updated successfully, but these errors were encountered: