Merged
Conversation
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
84f073e to
b09ed66
Compare
OpenAPI ChangesShow/hide ## Changes for v0.yaml:Unexpected changes? Ensure your branch is up-to-date with |
Comment on lines
26
to
+28
| if hasattr(instance, "feature_image"): | ||
| feature_img_src = get_wagtail_img_src(instance.feature_image) | ||
|
|
||
| return feature_img_src or static(DEFAULT_COURSE_IMG_PATH) | ||
| return get_wagtail_img_src(instance.feature_image) or None | ||
| return None |
There was a problem hiding this comment.
Bug: The ProgramCourseInfoCard.js component is not handling the new null value for feature_image_src, causing it to render without an image instead of using a default fallback.
Severity: MEDIUM
Suggested Fix
Update ProgramCourseInfoCard.js to handle a null value for feature_image_src. When the value is null, the component should render a default fallback image, similar to the implementation in EnrolledItemCard.js.
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#L26-L28
Potential issue: The serializer method `get_feature_image_src` was changed to return
`None` when a course lacks a feature image. While several frontend components were
updated to handle this by using a default image, the `ProgramCourseInfoCard.js`
component was not. This component's conditional check `if (course.feature_image_src)`
will evaluate to false when the value is `null`, causing it to render no image element
at all. This results in a missing image in the program enrollment drawer, which is a
functional regression.
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.
annagav
Carey P Gumaer