Skip to content

Conversation

@Anindra123
Copy link
Collaborator

Overview

The get_course_rating method in Utils class was returning all the rating regardless of whether it is published or unpublished this led to a mismatch to the total rating count and actual course rating.

Provided Fix

To fix this issue I have added {$wpdb->comments}.comment_approved = %s this line and made the value approved in the sql query to get only those ratings that are approved.

Further, to fix the count when user is enrolled into course and gives a review but it is pending, it should show user comment and it has status pending but the count should be only for approved review, i have removed the current_user_id parameter from get_course_review method so to only get the approved reviews

@shewa12 shewa12 merged commit 362585a into dev Jan 2, 2026
10 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants