Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translated slugs for linked stories are not replaced in the link object properly leaving non translated slugs in the rendered DOM #554

Open
SebbeJohansson opened this issue May 5, 2023 · 7 comments

Comments

@SebbeJohansson
Copy link

When linking to a translated page from another page, we see a behaviour where the non translated slug is what is returned in the link object, despite the translated slug being present in the links object and in the story object within the link object.

Expected Behavior

We expect that the proper slug is presented in the link object so that we can always trust the link inside of the same place.

Current Behavior

The wrong slug is presented.

How it looks in the story object coming from the storyApi.get() method:
image

Steps to Reproduce

  1. Connect two stories together by linking from one of them to the other.
  2. Go to the story that is linked from.
  3. Check the returned link.

Suggested solutions

  • Make the link object more clear to only have one place where the link can be, instead of the 4-5 different ones that is possible right now.
  • Provide the translated link right in the link object.
@SebbeJohansson
Copy link
Author

After upgrading to lastest this is also now not working with story resolve relations.

@ademarCardoso
Copy link
Member

After upgrading to lastest this is also now not working with story resolve relations.

One question, is this problem in resolve relations only with many stories? for example with more than 25 ?

@SebbeJohansson
Copy link
Author

@ademarCardoso Hi! Nope this problem exists with any number of them. This seems to only happen in our big nuxt2 application and only on the server. The weirdest part of this is that it is working in a server side middleware.

I have tried to reproduce this in a stackblitz but haven't been able to. Here is my attempt: https://stackblitz.com/edit/nuxt-2-sdk-demo-mbnbsu?file=package.json

I have been talking to @alvarosabu and @Dawntraoz about this on discord (cant remember if you were involved there or not, but i don't think so). Also had a ball with Alvaro where we couldn't reproduce it, but verified that this issue is present in the big application.

As a workaround we are trying to make an edge function in Fastly to handle all our storyblok requests. The reason initially for this was to cache and obscure our fetching, but now this will be another reason to do it.

@sumerokr
Copy link

sumerokr commented May 22, 2023

One of the biggest pain points in Storyblok is how to resolve translated links. This is such a baseline feature, but mostly broken.
See storyblok/storyblok#694, storyblok/storyblok#812, storyblok/storyblok#884, storyblok/storyblok#728 that are open for months and even years.
You want to have a "Link" field that links to another page? Sure you can, but without a "name" field at all (page title).
And when you try to solve it using "resolve_links" thing, "name" (page title) property is there, but not translated. Such a bad joke.

@SebbeJohansson
Copy link
Author

For me specifically this is happening inside a nuxt2 project and I am still not able to reproduce it in a different nuxt2 project.

@bezrodnow
Copy link

Has anyone found a solution or workaround for this issue so far? I am currently stuck on this as well.

@SebbeJohansson
Copy link
Author

@bezrodnow Nope as far as i can tell this is still an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants