Skip to content

fix: salesforce commerce cloud when there is a untitled product listing from salesforce [INTEG-3036]#10070

Merged
ryunsong-contentful merged 1 commit intomasterfrom
INTEG-3036
Aug 19, 2025
Merged

fix: salesforce commerce cloud when there is a untitled product listing from salesforce [INTEG-3036]#10070
ryunsong-contentful merged 1 commit intomasterfrom
INTEG-3036

Conversation

@ryunsong-contentful
Copy link
Copy Markdown
Contributor

@ryunsong-contentful ryunsong-contentful commented Aug 18, 2025

Purpose

JIRA Link: https://contentful.atlassian.net/browse/INTEG-3036
Zendesk link: https://contentful.atlassian.net/browse/ZEND-6790

User noted an issue in zendesk
Screenshot 2025-08-18 at 3 03 26 PM

With the fix it now does this
Screenshot 2025-08-18 at 3 12 14 PM

Root Cause

The error was caused by unsafe property access patterns where .default properties were accessed without proper null/undefined checks:

// PROBLEMATIC CODE
{product.name.default}                    // Crashes if product.name is undefined
{product.image.alt.default}               // Crashes if image or alt is missing
if (product.shortDescription.default)     // Crashes if shortDescription is undefined

Solution

1. Implemented Safe Property Access
Replaced unsafe property access with optional chaining (?.) and nullish coalescing (||) operators:

// FIXED CODE
{product.name?.default || 'Untitled Product'}
{product.image?.alt?.default || 'Product image'}  
if (product.shortDescription?.default) { ... }

2. Fixed Modal UI Structure

  • Removed conflicting wrapper causing header overlap
  • Fixed sticky positioning
  • Improved spacing and alignment
  • Added proper scrolling for search results

@ryunsong-contentful ryunsong-contentful requested a review from a team as a code owner August 18, 2025 21:13
@netlify
Copy link
Copy Markdown

netlify Bot commented Aug 18, 2025

Deploy Preview for ecommerce-app-base-components canceled.

Name Link
🔨 Latest commit 2be80ca
🔍 Latest deploy log https://app.netlify.com/projects/ecommerce-app-base-components/deploys/68a39785bf7b780008eea002

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.

Approving so this doesn’t block the main fix.

One small note from the screenshots: the modal design could be tightened up a bit. There seems to be extra padding in the modal content area that slightly throws off the overall layout. Not a blocker, but maybe worth refining later.

@ryunsong-contentful ryunsong-contentful merged commit 89c0cc0 into master Aug 19, 2025
19 checks passed
@ryunsong-contentful ryunsong-contentful deleted the INTEG-3036 branch August 19, 2025 15:05
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