Skip to content

Fix PHP notices on course report Students view - #8303

Merged
donnapep merged 4 commits into
trunkfrom
fix/reports-item-module-column
Oct 1, 2026
Merged

donnapep merged 4 commits into
trunkfrom
fix/reports-item-module-column

Conversation

@donnapep

@donnapep donnapep commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Proposed Changes

  • Skip the Modules report-column callback when its row item is not a lesson post.
  • Prevent course student report rows from attempting to read a nonexistent Reports_Item::$ID property.

Testing Instructions

  • Enable WordPress debug logging and open Sensei LMS > Reports > Courses in wp-admin.
  • Select a course that has enrolled students.
  • Click Students taking this Course and confirm the student table loads normally.
  • Confirm loading the table does not add a Reports_Item::$ID notice to the WordPress debug log.
  • Click Lessons in this Course and confirm the lesson report still loads normally.

Copilot AI balanced review requested due to automatic review settings October 1, 2026 19:22
@donnapep donnapep added this to the 4.26.5 milestone Oct 1, 2026

Copilot AI left a comment

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.

Copilot review overview

🟡 Changes recommended

Regression coverage is missing, and the updated parameter documentation remains inaccurate.

Review effort: Balanced
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

Fixes PHP notices in course student reports by restricting module-column processing to lesson posts.

Changes:

  • Guard module-column generation against non-lesson report rows.
  • Add a patch changelog entry.
File Description
includes/​class-sensei-modules.php Skips module lookup for non-lesson rows.
changelog/​fix-reports-item-module-column Documents the notice fix.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread includes/class-sensei-modules.php Resolved
Comment thread includes/class-sensei-modules.php Resolved
@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

WordPress Playground Preview

The changes in this pull request can previewed and tested using a WordPress Playground instance.

Open WordPress Playground Preview

@donnapep donnapep self-assigned this Oct 1, 2026
@donnapep donnapep changed the title Fix PHP notices in course student reports Fix PHP notices on course report Students view Oct 1, 2026
@donnapep
donnapep merged commit 83f26fb into trunk Oct 1, 2026
23 checks passed
@donnapep
donnapep deleted the fix/reports-item-module-column branch October 1, 2026 20:24
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