Skip to content

Fix PHP fatal when removing student from a course#7828

Merged
donnapep merged 2 commits intotrunkfrom
fix/error-removing-student
May 31, 2025
Merged

Fix PHP fatal when removing student from a course#7828
donnapep merged 2 commits intotrunkfrom
fix/error-removing-student

Conversation

@donnapep
Copy link
Copy Markdown
Contributor

@donnapep donnapep commented May 31, 2025

Resolves #7740.

Proposed Changes

Checks if $questions_array is empty before running code that manipulates it.

Testing Instructions

I wasn't actually able to reproduce, but this is a fairly benign change that should resolve the fatal.

Pre-Merge Checklist

  • PR title and description contain sufficient detail and accurately describe the changes
  • Adheres to coding standards (PHP, JavaScript, CSS, HTML)
  • All strings are translatable (without concatenation, handles plurals)
  • Follows our naming conventions (P6rkRX-4oA-p2)
  • Hooks (p6rkRX-1uS-p2) and functions are documented
  • New UIs are responsive and use a mobile-first approach
  • Code is tested on the minimum supported PHP and WordPress versions

@donnapep donnapep added this to the 4.25.1 milestone May 31, 2025
@donnapep donnapep self-assigned this May 31, 2025
@donnapep donnapep changed the title Fix PHP fatal when calling array_rand on empty array Fix PHP fatal when removing student from a course May 31, 2025
@donnapep donnapep merged commit a289c0b into trunk May 31, 2025
23 checks passed
@donnapep donnapep deleted the fix/error-removing-student branch May 31, 2025 12:12
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.

Error when removing a student from course

1 participant