datocms / gatsby-source-datocms

Official GatsbyJS source plugin to pull content from DatoCMS
MIT License
140 stars 50 forks source link

2.5.7 Breaks Dato CMS locale fallbacks #137

Closed chrisworman-pela closed 3 years ago

chrisworman-pela commented 3 years ago

It appears that 2.5.7 breaks Dato CMS locale fallbacks.

This is a serious issue for us since 2.5.7 contains a fix for an (unrelated) issue that we are experiencing.

The Dato CMS locale fallback feature is described here: https://github.com/datocms/gatsby-source-datocms#how-to-use

Overview

I have created a repository that contains a minimal example. The repository contains two (relevant) branches that only differ in the version of gatsby-source-datocms defined in package.json.

The app is meant to show that 2.3.0 will properly resort to the locale fallback, while 2.5.7 does not. My demo Gatsby web app is setup to query for en-US records with a fallback locale of en.

I have created a simple Dato CMS instance that has 1 model (Article) with three fields and 1 record. The model has two localized fields (title and body) and one non-localized field (slug). See the screen shots below for details.

Screen Shot 2021-01-06 at 2 27 25 PM

Screen Shot 2021-01-06 at 2 27 36 PM

Steps to Show 2.3.0 Works

git clone git@github.com:chrisworman-pela/gatsby-datocms-sandbox.git
cd gatsby-datocms-sandbox
git checkout gatsby-source-datocms-2.3.0
yarn install && gatsby develop

In the gatsby develop log you should see the following:

info Creating page for blogArticleNode {
  "slug": "article-1",
  "title": "Article 1",
  "body": "This is the first blog article."
}

You should be able to view the page generated for the Article by visiting http://localhost:8000/blogs/article-1. Notice that the title and body show the expected values.

Steps to Show 2.5.7 Fails

git checkout gatsby-source-datocms-2.5.7
yarn install && gatsby develop

In the gatsby develop log you should see the following:

info Creating page for blogArticleNode {
  "slug": "article-1",
  "title": null,
  "body": null
}

You should be able to view the page generated for the Article by visiting http://localhost:8000/blogs/article-1. Notice that the title and body are null.

chrisworman-pela commented 3 years ago

@matjack1 Is it possible to get an ETA on when this issue can at least be verified to be a bug?

stefanoverna commented 3 years ago

didn't have time to reproduce it today, will be the first thing I'll do on Monday ok? :(

— Stefano Verna

DatoCMS

--- original message --- On January 8, 2021, 5:28 PM GMT+1 notifications@github.com wrote:

@matjack1 Is it possible to get an ETA on when this issue can at least be verified to be a bug?

You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub, or unsubscribe. --- end of original message ---

chrisworman-pela commented 3 years ago

Thanks @stefanoverna!

stefanoverna commented 3 years ago

Found the regression and fixed in acbf88b60e39c6a6c017ae2df6dfd660b1a5dce4, thanks so much @chrisworman-pela for the thorough info!

chrisworman-pela commented 3 years ago

Thanks so much for this @stefanoverna !!