Skip to content

MCR-3890 follow MCR.XMLParser.ValidateSchema when loading MCRBase from URI - #3193

Merged
kkrebs merged 2 commits into
2023.06.xfrom
issues/MCR-3890-Load_from_URI_ignores_ValidateSchema
Oct 28, 2026
Merged

kkrebs merged 2 commits into
2023.06.xfrom
issues/MCR-3890-Load_from_URI_ignores_ValidateSchema

Conversation

@sebhofmann

Copy link
Copy Markdown
Member

Link to jira

MCRBase.setFromURI has used a hard coded non validating parser since the clean up in MCR-2862 (27bc8fcc2c). It follows MCR.XMLParser.ValidateSchema again, as it did before. This affects new MCRObject(URI) and new MCRDerivate(URI), and with them the CLI load/update commands and the REST API v1 object upload.

Pull Request Checklist (Author)

Ticket & Documentation

  • The issue in the ticket is clearly described and the solution is documented.

Bugfix-Specific Checks

  • Affected version is listed in the ticket.
  • Minimal code changes were made (no refactoring).
  • This PR truly fixes only the reported bug.

Testing

  • I have tested the changes locally. (module compiles, tests not run yet, no test added)

protected final void setFromURI(URI uri) throws JDOMException, IOException {
setFromXML(new MCRURLContent(uri.toURL()).asByteArray(), false);
setFromXML(new MCRURLContent(uri.toURL()).asByteArray(),
MCRConfiguration2.getOrThrow("MCR.XMLParser.ValidateSchema", Boolean::parseBoolean));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Did you consider reusing
MCRXMLParserFactory.VALIDATE_BY_DEFAULT
here?

@kkrebs
kkrebs merged commit 26a4df3 into 2023.06.x Oct 28, 2026
3 of 4 checks passed
@kkrebs
kkrebs deleted the issues/MCR-3890-Load_from_URI_ignores_ValidateSchema branch October 28, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants