Closed
Conversation
OpenAPI ChangesShow/hide ## Changes for v0.yaml:Unexpected changes? Ensure your branch is up-to-date with |
Comment on lines
+27
to
29
| return get_wagtail_img_src(instance.feature_image) or None | ||
| return None | ||
|
|
There was a problem hiding this comment.
Bug: The ProgramCourseInfoCard.js component was not updated to handle a null feature_image_src, causing a missing image for courses in the program enrollment drawer.
Severity: MEDIUM
Suggested Fix
Update ProgramCourseInfoCard.js to provide a fallback to a default image when course.feature_image_src is null or falsy. This can be done by using a logical OR operator, for example: const imageUrl = course.feature_image_src || DEFAULT_COURSE_IMG;.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: cms/serializers.py#L27-L29
Potential issue: The `get_feature_image_src` method in serializers like
`BaseCoursePageSerializer` was modified to return `None` instead of a default image path
if no image exists. While several frontend components were updated to handle this change
by providing a fallback image, the `ProgramCourseInfoCard.js` component was missed. This
component checks `if (course.feature_image_src)` before rendering an image. When the API
returns `null` for this field, the condition fails, and no image is rendered at all.
This causes a missing image in the UI for courses within the program enrollment drawer
that do not have a specific feature image set.
Did we get this right? 👍 / 👎 to inform future reviews.
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.
Carey P Gumaer