MDL-86018 tool_xmldb: Check XML content in reconciler

This commit is contained in:
Andrew Nicols
2025-11-25 15:02:18 +00:00
committed by Paul Holden
parent a158a2043a
commit 045967e885
@@ -90,8 +90,15 @@ class reconcile_files extends XMLDBAction {
// Generate the XML contents from the loaded structure.
$xmlcontents = $xmldb->getStructure()->xmlOutput();
$correctdom = new \DOMDocument();
$correctdom->loadXML($xmlcontents);
$correct = $correctdom->saveXML();
if ($rawcontents != $xmlcontents) {
$currentdom = new \DOMDocument();
$currentdom->loadXML($rawcontents);
$current = $currentdom->saveXML();
if ($current !== $correct) {
$relpath = str_replace($CFG->dirroot . '/', '', $key) . '/install.xml';
$needfix[] = $relpath;
// Left here on purpose, as a quick way to fix problems. To be