Fix HubSpot blog author name - #687
Merged
Merged
Conversation
djohalo2
marked this pull request as ready for review
August 21, 2026 07:42
Contributor
There was a problem hiding this comment.
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 mapauthorNameto 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
syncBlogsfetches blog authors unconditionally fromposts.map(post => post.blogAuthorId). If theblogAuthorIdproperty wasn't requested/returned (e.g. whenauthorNameisn't a field in the collection), this can produceundefinedIDs and callfetchBlogAuthor(undefined), which will fail and break the sync. Gate author resolution on whetherblogAuthorIdwas 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.
djohalo2
force-pushed
the
fix/hubspot-plugin-blog-author-name
branch
from
August 21, 2026 07:46
efdb09d to
5f56930
Compare
huntercaron
reviewed
Aug 21, 2026
huntercaron
approved these changes
Aug 21, 2026
huntercaron
left a comment
Collaborator
There was a problem hiding this comment.
Silly that we have to do this at all but nice fix thank you!
Contributor
Author
|
@huntercaron Yeah their property name is very misleading... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
authorNameis 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
authorNamefield id, but populate it with the fetched blog author name.Changelog
Testing