Magento 2 Invalid Document Element ‘resource’: The attribute ‘title’ is required but missing

当我magento setup:upgrade在运行模式上运行它并显示以下注释时

Running schema recurring...Invalid Document Element 'resource': The attribute 'title' is required but missing. Line: 12

Element 'resource': The attribute 'title' is required but missing. Line: 13
no title

解决办法:

1.为title设置值

2. 取消掉title必须验证的属性

setup:upgrade 过程可能应该做一些飞行前检查以确保它可以进行升级。

如果您在尝试在数十个 acl.xml 文件中查找缺失的标题时遇到困难,但需要快速让网站重新上线,那么快速的解决方法是使标题属性成为可选而不是必需的。

编辑 vendor/magento/framework/Acl/etc/acl_merged.xsd

找到:

<xs:attribute name="title" type="typeTitle" use="required" />

我最近遇到了同样的问题。一些观察和解决方法。

1)如果不是“无效文件”而是告诉您哪个文件无效,这将非常有帮助。

2) setup:upgrade 过程可能应该做一些飞行前检查以确保它可以进行升级。

无论如何,如果您在尝试在数十个 acl.xml 文件中查找缺失的标题时遇到困难,但需要快速让网站重新上线,那么快速的解决方法是使标题属性成为可选而不是必需的。

编辑 vendor/magento/framework/Acl/etc/acl_merged.xsd

找到线

<xs:attribute name="title" type="typeTitle" use="required" />

用下面来来代替

xs:attribute name="title" type="typeTitle" use="optional" />

就是把required 修改成optional