statamic / ssg

The official Statamic Static Site Generator
229 stars 23 forks source link

Multisite Non-localised content leaking through #69

Closed adnweedon closed 2 years ago

adnweedon commented 2 years ago

I have a multisite website set up with a number of sites, but only some of the content is localised. My homepage has an entries field, that displays in a table. On the live site, the entries that have not been localised do not show up, until we go into the dashboard and create a localised version. When I generate the SSG, however, the generated localised page shows the original locale version of those entries in the table, rather than not showing.

Live version: image

SSG Version: image

Interestingly, if I remove one of the entries on a localised page, it disappears in the SSG, though the others still remain the original locale. Also, even if I have a localised version of an entry, that isn't used, and the original locale entries are shown instead.

This is running on PHP8, Statamic 3.1.32, SSG 0.6.0 - not sure what other information is helpful!

tao commented 2 years ago

I have a large multi-site and I'm starting to test it with SSG... however I don't think I've come across this problem yet. I have a bit of trouble understanding the issue though... maybe if you have time (and this is still a problem) you could create a demo repository that we can clone and see the error. Maybe then I can help you with some debugging then and figure out what's going wrong.

adnweedon commented 2 years ago

Sure thing!

https://github.com/adnweedon/statamic-test

Hopefully you can access this. If you go to the root, you will see English content, if you go to /german you will see german content. If you generate the SSG, both show german content!

Ant

tao commented 2 years ago

It seems like it might be a bug with the Replicator field. I don't use that in my site so I haven't come across this issue before.

If you add markdown content to each of these pages then it generates correctly on SSG, however it's not working with this field. I also tried changing the german entry to use the german feature ID instead of the english origin ID and it didn't work.

It randomly generates either English or German for me on both pages using SSG. This could be related to some of the issue with multi-site content leaking through pages.

Hopefully the you provided demo will help the devs narrow down the issue.

adnweedon commented 2 years ago

I guess it may well be, thanks for having a look anyway! Our whole site is built on replicators, with standard fieldsets that you just drop in, each linked to preformatted partials, so it's rather a crucial feature!

jasonvarga commented 2 years ago

Worked this out. It only happened because you were using an import in your blueprint. Funky!

jasonvarga commented 2 years ago

(The provided repo was super helpful in tracking this down, thank you!)

jasonvarga commented 2 years ago

This was fixed on the Statamic side, not in the SSG, so make sure you update once 3.2.8 is out.

adnweedon commented 2 years ago

Thanks so much!!!