datocms / gatsby-source-datocms

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

media asset default alt and title not respected #200

Closed dw-srohrlack closed 2 years ago

dw-srohrlack commented 2 years ago

The default alt and title text of media assets is not being respected in different locales.

Scope: potentially all references to datocms assets

Steps to reproduce:

  1. add a default alt- and title-text in multiple locales for a media asset in the asset manager
  2. create a model that uses a localised media field and a localised modular content field and create a block for that modular content which has a "media" field
  3. create a record that uses the aforementioned asset in the image field and modular content block's image field - but don't define a specific alt- and title-text
  4. query the record via the gatsbyjs graphql interface, try out different locales

Expected result: the alt- and title-text of the asset is localised based on the requested locale

Result: the alt- and title-text are not using the respective default values for the respective locale

Tested plugin versions: 4.0.4

stefanoverna commented 2 years ago

Hello @dw-srohrlack... version 4 is known to have problems with localization. We're working on a new version of this plugin that should solve all the issues, and introduce more flexibility.

You can try it installing gatsby-source-datocms@next on your project — but it must be upgraded to gatsby ^4.24.0!

dw-srohrlack commented 2 years ago

Hi @stefanoverna , downgrading to 3.0.19 seems to have fixed the issue. I can't find much details in the releases regarding what's different in v4 except it produces less graphql nodes - am I fine running v3 until we get around to upgrading to v5 or am I missing out on important stuff from v4?

stefanoverna commented 2 years ago

If you're satisfied with 3.0.19.. than stick with 3.0.19 :)

Here's what changes in v5: https://www.datocms.com/product-updates/new-gatsby-source-plugin-faster-build-times