Skip to content

fix: prevent 'null' display when instructor family_name is missing#4711

Open
rjv31 wants to merge 1 commit intoopenedx:masterfrom
rjv31:handle-missing-family-name-in-instructor-profile
Open

fix: prevent 'null' display when instructor family_name is missing#4711
rjv31 wants to merge 1 commit intoopenedx:masterfrom
rjv31:handle-missing-family-name-in-instructor-profile

Conversation

@rjv31
Copy link
Copy Markdown
Contributor

@rjv31 rjv31 commented Mar 31, 2026

Issue

Instructor profiles display "null" when family_name is missing.

2U Ticket

https://2u-internal.atlassian.net/browse/CATALOG-87

Root Cause

The marketing site integration was using full_name directly, which could include null values.

Fix

  • Updated name construction in MarketingSitePeople to safely handle missing family_name
  • Ensured only valid name parts are included
  • Added test coverage for missing and empty family_name cases

Testing

  • Verified profiles with and without family_name
  • Confirmed no "null" appears in marketing site payload

@rjv31 rjv31 force-pushed the handle-missing-family-name-in-instructor-profile branch 2 times, most recently from 807dc00 to c0e9734 Compare March 31, 2026 07:44
@rjv31 rjv31 force-pushed the handle-missing-family-name-in-instructor-profile branch from c0e9734 to cc1e92c Compare April 8, 2026 10:27
@rjv31 rjv31 marked this pull request as ready for review April 8, 2026 10:48
)

def _get_node_data(self, person):
full_name = " ".join(filter(None, [person.given_name, person.family_name]))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@rjv31

This has two issues:

It silently drops the salutation field — if a person has salutation="Dr.", given_name="Jane", family_name="Smith", the model's full_name returns "Dr. Jane Smith", but this code would send "Jane Smith" to the marketing site.

It's redundant — person.full_name already handles None family_name correctly, so the fix doesn't actually change the behavior for the stated bug scenario (null family_name).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants