gatsby-uc / gatsby-source-strapi

Gatsby source plugin for building websites using Strapi as a data source
MIT License
354 stars 182 forks source link

Fix content refresh and relation images #344

Closed remidej closed 2 years ago

remidej commented 2 years ago

Linked issues:

Both issues are hard to test, but prevent several users from using the plugin. I think we should ship this as a pre-release to get real work feedback

laurenskling commented 2 years ago

I just tried 2.1.0-alpha.0 and that fixes the bug where my rich content is reset to null upon refetching it after an update.

But it actually broke images at one place. I have a component with

images: {
      type: 'media',
      multiple: true,
    },

and these are no longer available with localFile. They are included in the api response, but no longer handled by the source plugin (which was the case in 2.0.0)

edit: it also happens on non-repeatable components, and can confirm quoting the extractImages function again fixes it

laurenskling commented 2 years ago

@remidej fixed it in gatsby-uc/gatsby-source-strapi#348, the problem was the return statement. I had relationships in the component, it broke looping over the rest of my content.