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.
Create a story (A) with a reference (Single-Option Field Options: Source: Stories) to another story (B).
Create a Release (R) in Storyblok and change some content of story (B) in Release (R)
Fetch Story (A) using getStory with the from_release and resolve_relations parameters
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:
Uh oh!
There was an error while loading. Please reload this page.
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.Steps to Reproduce
getStory
with thefrom_release
andresolve_relations
parametersPossible Solution
src/index.ts
The same may be required for
resolveLinks()
.Thanks!
The text was updated successfully, but these errors were encountered: