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

fix(gatsby-source-wordpress): Add image cdn fields on updates #35687

Merged
merged 1 commit into from
May 18, 2022

Conversation

TylerBarnes
Copy link
Contributor

There's currently a bug where image cdn fields are not added to MediaItem nodes if those nodes are edited directly in WP - for example rotating or renaming an image. All incremental builds since the edit will fail with an image cdn error because on delta updates to MediaItems we weren't adding the right image cdn fields.

There's clearly some tech debt here as the createMediaItem function is only used for initial builds, not for delta updates. I don't want to make a large refactor in this PR though so I'm adding the image cdn fields in both places with a new addImageCDNFieldsToNode function.

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label May 18, 2022
@TylerBarnes TylerBarnes requested review from wardpeet and veryspry May 18, 2022 01:17
@TylerBarnes TylerBarnes added topic: source-wordpress Related to Gatsby's integration with WordPress and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels May 18, 2022
@TylerBarnes
Copy link
Contributor Author

Canary available as gatsby-source-wordpress@6.15.0-alpha-wp-image-cdn-inc.15

Copy link
Contributor

@veryspry veryspry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense!

@TylerBarnes TylerBarnes merged commit 54832b4 into master May 18, 2022
@TylerBarnes TylerBarnes deleted the fix/wp-image-inc-builds branch May 18, 2022 19:15
LekoArts pushed a commit that referenced this pull request May 19, 2022
add image cdn fields on updates too

(cherry picked from commit 54832b4)
LekoArts pushed a commit that referenced this pull request May 19, 2022
#35694)

Co-authored-by: Tyler Barnes <tylerdbarnes@gmail.com>
@LekoArts
Copy link
Contributor

Successfully published:

  • gatsby-source-wordpress@6.14.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: source-wordpress Related to Gatsby's integration with WordPress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants