Skip to content

Prevent closure serialisation error in debug backtrace#3073

Open
weilai-irl wants to merge 1 commit intoMOODLE_500_STABLEfrom
wip-126551-m500
Open

Prevent closure serialisation error in debug backtrace#3073
weilai-irl wants to merge 1 commit intoMOODLE_500_STABLEfrom
wip-126551-m500

Conversation

@weilai-irl
Copy link
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings February 27, 2026 11:21
@weilai-irl weilai-irl self-assigned this Feb 27, 2026
@weilai-irl weilai-irl added this to the 2026-01 milestone Feb 27, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a potential serialization error in the debug logging functionality by preventing closures (anonymous functions) in function arguments from being captured in debug backtraces. The change applies the DEBUG_BACKTRACE_IGNORE_ARGS flag to debug_backtrace() calls to exclude function arguments, which could contain non-serializable closures that would cause errors when the event data is stored.

Changes:

  • Modified debug_backtrace() call in local/o365/classes/utils.php to use DEBUG_BACKTRACE_IGNORE_ARGS flag

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

debug() may trigger fatal error "Serialization of 'Closure' is not allowed"

2 participants