Reject invalid initial XML uploads by default - #1863
Open
adamant-pwn wants to merge 9 commits into
Open
adamant-pwn wants to merge 9 commits into
adamant-pwn wants to merge 9 commits into
Conversation
Member
|
@EJMFarrow could you review this please? |
EJMFarrow
requested changes
Sep 11, 2026
EJMFarrow
left a comment
Collaborator
There was a problem hiding this comment.
Thanks, @adamant-pwn . Looks great! I've switched the PR to target dev which is our normal workflow. This has caused some merge conflicts. The behaviour to update Moodle status also needs removed and the tests updated, please.
(@sangwinc I can't think of a situation where this import behaviour change is going to cause us a problem but worth you having a think too. Course restore doesn't use this process as far as I can tell so I think we're safe there.)
…o codex/stop-invalid-xml-imports
Author
|
Thanks, @EJMFarrow! I’ve merged dev, resolved the conflicts, and removed the automatic Moodle status change. The updated tests and release note preserve the separation from STACK’s broken flag. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
STACK XML parsing can retain invalid authoring content with diagnostics. Count these failures in Moodle's import error total so the normal Stop on error policy rejects an initial upload before writing questions, including mixed valid/invalid batches.
Disabling Stop on error explicitly permits repairable broken questions with diagnostics. Structurally unreadable questions remain rejected. Moodle's Draft/Ready status stays independent of STACK's broken flag; this PR does not change version status.
Merged current
devand resolved the conflicts. The Behat test retains the generic expand-all-fieldsets step, and the release note is in the development track.Validation on Moodle 5.0.10, PHP 8.3.33, PostgreSQL 17.11 and Maxima 5.45.1 (ECL): 12 focused tests / 132 assertions passed (six initial-upload policy cases and six XML-import regressions). PHP syntax and diff checks passed. PHPUnit reported deprecations. Browser/Behat flows and the wider CI matrix have not been run locally.