Skip to content

Fix HubSpot blog author name - #687

Merged
djohalo2 merged 2 commits into
mainfrom
fix/hubspot-plugin-blog-author-name
Aug 21, 2026
Merged

Fix HubSpot blog author name#687
djohalo2 merged 2 commits into
mainfrom
fix/hubspot-plugin-blog-author-name

Conversation

@djohalo2

@djohalo2 djohalo2 commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Description

This pull request fixes an issue where hubspot blog author name was synced with last editor name instead of the actual linked author name. The field authorName is a bit confusing, but according to their docs indeed something else than what you would expect (https://developers.hubspot.com/docs/api-reference/latest/cms/blogs/posts/create-post#body-author-name)

To keep this change backwards compatible, we keep using the original authorName field id, but populate it with the fetched blog author name.

Changelog

  • Fixed synced blog posts showing the last editor name instead of the linked author name.

Testing

  • Sync a hubspot blog post and verify the author name is now populated with actual blog author that you linked to the post and not the last updated name

@djohalo2 djohalo2 changed the title Fix Hubspot blog author name Fix HubSpot blog author name Aug 21, 2026
@djohalo2
djohalo2 marked this pull request as ready for review August 21, 2026 07:42
Copilot AI lite review requested due to automatic review settings August 21, 2026 07:42
@github-actions github-actions Bot added the Auto submit to Marketplace on merge Submits the plugin to the marketplace after merging label Aug 21, 2026
@djohalo2
djohalo2 requested a review from huntercaron August 21, 2026 07:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR corrects how HubSpot blog post authors are synced into Framer managed collections by using the linked blog author (via blogAuthorId) rather than HubSpot’s authorName value, which represents the last editor.

Changes:

  • Adds an API helper to fetch a HubSpot blog author by ID.
  • Enhances blog sync to request blogAuthorId (when needed), fetch author records, and map authorName to the linked author’s display name.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
plugins/hubspot/src/blog.ts Requests blogAuthorId, fetches author names, and uses them to populate the existing authorName field.
plugins/hubspot/src/api.ts Adds fetchBlogAuthor() and a query key for cached author lookups.
Suppressed comments (1)

plugins/hubspot/src/blog.ts:250

  • syncBlogs fetches blog authors unconditionally from posts.map(post => post.blogAuthorId). If the blogAuthorId property wasn't requested/returned (e.g. when authorName isn't a field in the collection), this can produce undefined IDs and call fetchBlogAuthor(undefined), which will fail and break the sync. Gate author resolution on whether blogAuthorId was requested and filter IDs to valid non-empty strings.
    const authorIds = Array.from(new Set(posts.map(post => post.blogAuthorId)))
    const authors = authorIds.length ? await Promise.all(authorIds.map(fetchBlogAuthor)) : []
    const authorNamesById = new Map(authors.map(author => [author.id, author.displayName]))

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread plugins/hubspot/src/blog.ts
@djohalo2
djohalo2 force-pushed the fix/hubspot-plugin-blog-author-name branch from efdb09d to 5f56930 Compare August 21, 2026 07:46
Comment thread plugins/hubspot/src/blog.ts Outdated
@djohalo2
djohalo2 requested a review from huntercaron August 21, 2026 10:21

@huntercaron huntercaron left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Silly that we have to do this at all but nice fix thank you!

@djohalo2

Copy link
Copy Markdown
Contributor Author

@huntercaron Yeah their property name is very misleading...

@djohalo2
djohalo2 added this pull request to the merge queue Aug 21, 2026
Merged via the queue into main with commit 7f897b7 Aug 21, 2026
10 checks passed
@djohalo2
djohalo2 deleted the fix/hubspot-plugin-blog-author-name branch August 21, 2026 10:31
@djohalo2
djohalo2 deployed to production August 21, 2026 10:31 — with GitHub Actions Active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto submit to Marketplace on merge Submits the plugin to the marketplace after merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants