欠落している属性を持つファイルを見つけるには、次のファイルを変更できます
vendor/magento/framework/Config/Reader/Filesystem.php
次のコードを追加
foreach($configMerger->getDom()->getElementsByTagName('resource') as $element ){
if (!$element->hasAttribute('title')) {
var_dump($configMerger->getDom()->saveXML($element));
}
}
メソッドへ
protected function _readFiles($fileList)
のように見えるはずです
protected function _readFiles($fileList)
{
/** @var \Magento\Framework\Config\Dom $configMerger */
$configMerger = null;
foreach ($fileList as $key => $content) {
try {
if (!$configMerger) {
$configMerger = $this->_createConfigMerger($this->_domDocumentClass, $content);
} else {
$configMerger->merge($content);
}
} catch (\Magento\Framework\Config\Dom\ValidationException $e) {
throw new \Magento\Framework\Exception\LocalizedException(
new \Magento\Framework\Phrase("Invalid XML in file %1:\n%2", [$key, $e->getMessage()])
);
}
}
if ($this->validationState->isValidationRequired()) {
$errors = [];
if ($configMerger && !$configMerger->validate($this->_schemaFile, $errors)) {
foreach($configMerger->getDom()->getElementsByTagName('resource') as $element ){
if (!$element->hasAttribute('title')) {
var_dump($configMerger->getDom()->saveXML($element));
}
}
$message = "Invalid Document \n";
throw new \Magento\Framework\Exception\LocalizedException(
new \Magento\Framework\Phrase($message . implode("\n", $errors))
);
}
}
$output = [];
if ($configMerger) {
$output = $this->_converter->convert($configMerger->getDom());
}
return $output;
}
これで、間違ったXML要素のダンプを見ることができます。