Fatal error 'Class "DOMDocument" not found' during starter site XML import when PHP dom extension is missing
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
Direzione di ricerca
Leggi includes/Importers/WP/WXR_Parser.php e includes/Importers/WP/WXR_Parser_SimpleXML.php per ricostruire la selezione del parser e la sua dipendenza da DOMDocument. Riproduci il problema con SimpleXML disponibile e DOM assente, poi verifica se il parser di Beaver Builder ha la stessa dipendenza. Il lavoro è completato quando l’importazione viene analizzata con un parser disponibile oppure restituisce un errore comprensibile invece di bloccarsi.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
Importing a starter site's content fails with an uncaught fatal error: Class "DOMDocument" not found. Expected: the import either parses the XML using an available parser or fails gracefully with a readable error. Actual: the import request crashes with a fatal error. Impact: the site cannot import starter content; the user deactivated the plugin about two hours after install.
Customer context
- Product / area: Templates Patterns Collection, starter site content import (remote XML)
- Version: 1.4.7
- Environment: PHP environment appears to lack the DOM extension (inference from the error); other details not provided
- Integration / third party: None
- Reported error / symptom: Uncaught Error: Class "DOMDocument" not found
- Impact: Import fails; user deactivated plugin
Reproduction notes
Not reproduced. Likely workflow (inference): on a PHP install with simplexml loaded but the dom extension disabled, run a starter site content import via the REST import_remote_xml step. Exact environment not provided.
Diagnosis
Conclusion
The crash trace matches the code path. The parser selector appears to pick the SimpleXML parser based only on the simplexml extension, but that parser constructs a DOMDocument, which depends on the dom extension. Facts: trace and source align. Inference: the site lacks the dom extension.
Where this likely occurs
includes/Importers/WP/WXR_Parser.php—WXR_Parser::parse()approx. lines 66-72: checksextension_loaded( 'simplexml' )before instantiatingWXR_Parser_SimpleXML.includes/Importers/WP/WXR_Parser_SimpleXML.php—WXR_Parser_SimpleXML::parse()approx. line 30:new \DOMDocumentwith no dom-extension check.- Call chain per trace:
Rest_Serverimport_remote_xml,Content_Importer::import_file,WP_Import::import,WP_Import::parse.
Engineering notes
The Beaver Builder branch checks extension_loaded( 'xml' ), and the fallback branch checks xml, but neither covers the dom extension. A fatal Error is not caught by the WP_Error handling. Only one crash report was inspected.
Test coverage status
No relevant coverage was found during inspection.
What to verify or explore next
- May be worth reproducing on PHP with dom disabled and simplexml enabled.
- Checking whether the Beaver parser has the same dependency.
Unknowns / follow-up
The host's PHP extension list and the single-site prevalence are unknown.
Confidence
Confidence: 75/100
Source shows the parser selection only checks for the simplexml extension, while the SimpleXML parser instantiates DOMDocument (dom extension). Crash trace matches this path. No open issue found.
Source: automated uninstall feedback — templates-patterns-collection, 2026-10-22
Generated by bug-report-triage (ID: bug-report-triage_6adaea21413ba9.06600122)
- Lingua principale
- JavaScript
- Stelle
- 57
- Fork
- 10
- Merge medio
- 3g 9h
- PR unite (30g)
- 7
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Codeinwp/templates-patterns-collection
-
customer report feature-request-triage
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
[DEV] Move to PlaywrightForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
-
new feature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
Codeinwp/templates-patterns-collection#258 · 3 commenti ·
-
Add support for templates save for FSE Editor.Forse di nuovo libera @JohnPixle l’ha presa 1260 giorni fa e non c’è nessuna pull request aperta. Apertanew feature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
Codeinwp/templates-patterns-collection#248 · 19 commenti ·
Tutte le issue di Codeinwp/templates-patterns-collection
Issue simili
-
clientV2: Application Info header separators show as missing-character boxes without a CJK fontApertabug new-client
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
NUWCDIVNPT/stig-manager#2285 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
Fei2411/DeepSeek-Bot#922 · 1 reazione ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
DuarteSantos8/openGym#998 ·
I maintainer di solito rispondono entro 4 giorni
-
server errored
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
OpenTermsArchive/contrib-declarations#4273 ·
I maintainer di solito rispondono entro 1 giorno
-
needs-area-label
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 2 giorni