2

My system.xml in /etc/adminhtml is the reason for this error

<field id="vendor_role" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
    <label>User Roles</label><source_model>Admin\Role\Model\System\Config\Source\Roles</source_model>
</field>

 Warning: DOMXPath::query(): Invalid expression in /home/mysite/public_html/vendor/magento/framework/Config/Dom.php on line 273
  • So did you get the solution? – Shireen N Feb 28 '18 at 12:02
  • No @ShireenN can you help me – Ramesh KR Feb 28 '18 at 12:16
1

Since the vendor directory is generated automatically, I would try deleting the vendor directory and running composer install again. Also magento setup:upgrade once that happens (confirm database is up to data with package versions). magento cache:clean and reload your store front.

Beyond that, I would review the steps for creating admin configuration entries.

  • I can't understand because I'm learning magento 2 from past month only. Can you pls elaborate me. – Ramesh KR Mar 1 '18 at 7:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.