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

[gatsby-source-contentful] linkages may link to empty localized entry #4531

Closed
anjawaldbauer opened this issue Mar 14, 2018 · 1 comment
Closed

Comments

@anjawaldbauer
Copy link
Contributor

I discovered this during my work on #4517 (comment).

Context

In contentful, you may have multiple locales but only certain fields of certain content types may be localized. This is not properly supported for entries with only certain localized fields as described in #4169 (also related to #4168).

Example

I have a content type Navigation that has a non-localized field links which holds many references to entries of content type Link. A Link has a localized title field. A gatsby node for a localized Link should have a (reverse?) linkage to its parent Navigation node in the default locale but instead links to the completely empty localized node.

Problem description

I have now found out that entries of a content type which has no localized fields at all are also not supported correctly. Before creating linkages (and probably reverse linkages too), it is checked if the id is resolvable, but then the link does not point to the id, but to the localized id, whether there is a localized version of the linked entry or not. So far this has not been a huge problem because at least the completely empty localized node existed and could be linked to. In my PR #4517 I am working on omitting completely empty localized nodes, because they cause problems (#4170). When these nodes are filtered out, linking to these non-existing nodes cause a TypeError.

@KyleAMathews
Copy link
Contributor

Due to the high volume of issues, we're closing out older ones without recent activity. Please open a new issue if you need help!

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

2 participants