sensei
sensei copied to clipboard
Students Reports page showing blank
Two different users have reported this issue, using the latest version of Sensei Pro (WCPC) on their websites.
- 5853722-zen
- 5854567-zen
One of them reports that:
We are receiving a No Students Found message on this report. Courses are showing on the Courses tab. We have updated to v4.9.1. Our staging site is at v4.8.1 and is displaying our list of students correctly on the reports.
They tried a plugin/theme dance with no results; disabling Sensei Pro (WCPC) and using just Sensei LMS which did not help either.
Upon further investigation (Slack convo) @m1r0 replicated the issue by dropping the sensei_comment_type_user_id SQL index in the wp_comments table
To verify this is correct, we need to ask for a database dump, which is what I asked both users to provide.
Meanwhile, @Imran92 figured out a quick fix by disabling the part of the query that’s causing the issue:
add_filter( 'sensei_students_report_last_activity_filter_enabled', '__return_false' );
This would fix the issue but also disable the “Last Activity” feature in the reports -- worth noting for the users I offered this option to both users to try out.
Next steps depend on what and how the users can provide database dumps to check.
Support References
This comment is automatically generated. Please do not edit it.
- [ ] 5853722-zen
- [ ] 5854567-zen
- [ ] 6183929-zen
Relates to #6134.
User in 5854567-zen provided database backup file.
Updating the issue here with a fix.
Assuming that the sensei_comment_type_user_id index could have been removed manually from the database* -- and therefore the users may have access to the database, the fix requires manual action.
Manually recreating the index running CREATE INDEX sensei_comment_type_user_id ON wp_comments ( comment_type, user_id ); should fix the issue. The wp_comments can be replaced with the name of the comment table if it’s something else.
Noting that this fix won’t have the users lose the ability to filter by date in reports because of the snippet fix.
*investigations led possibly to the woo_idx_comment_type index is still present in the database, and both indexes are created at the same time in code. Hence, the sensei_comment_type_user_id index could have been manually deleted.
Additional note from Imran:
With certain versions of mysql, you may need to use the query with ‘global’, so the query to need to run is SET GLOBAL SQL_MODE ='ALLOW_INVALID_DATES';
Then you should run the index generating query CREATE INDEX sensei_comment_type_user_id ON c3_comments ( comment_type, user_id );
In case this still doesn’t work, bes to use the snippet fix for now until a fix is prepared.
This ticket 6183929-zen is possibly related:
I navigated to Sensei LMS>Reports and do not see any students listed. I can find the students under Courses but I do not see an average grade for students anywhere and need to know a cumulative score for all their lessons/quizzes...
Noting that this user also has issues with grading (GH issue here) so this might not be 100% the same issue.
This issue was reported by Gonzalo in Slack: p1705512099856069-slack-C03BXN7UQ5V
When adding the index to Gonzalo's site, I noticed that the sensei_comment_type_user_id index was missing but there was an existing index named comment_type_user_id. This might be important so I'm adding it here.
@m1r0 Just curious if we fixed this one or if it's still outstanding?
It's still outstanding. We did a manual fix in Gonzalo's case.
I couldn't determine why the index was not created. It's either a bug that happens in some specific case or the index was removed manually.