Skip to content

indexer.xml & mview.xml doesn't allow numbers in vendor name and class name #24323

Closed
@Jason-Sy

Description

@Jason-Sy

This issue is similar to #4470

Preconditions (*)

  1. Magento 2.3.0/1
  2. PHP 7.2

Steps to reproduce (*)

  1. Create a simple module with a vendor name which contains at least one number (ex. Mage2Vendor)
  2. Add a custom indexer to the module just like on the devdocs
<indexer id="mage2module_url_rewrites" view_id="mage2module_url_rewrites" class="Mage2Vendor\Module\Model\Indexer\UrlRewrites">
  <title translate="true">Title.</title>
  <description translate="true">Description.</description>
</indexer>
  1. setup:upgrade

Expected result (*)

  1. Normal Upgrade output & module gets properly installed.

Actual result (*)

  1. Console trows an error at running scheme:
Running schema recurring...The XML in file "/root/app/code/Mage2Vendor/Module/etc/indexer.xml" is invalid:
Element 'indexer', attribute 'class': [facet 'pattern'] The value 'Mage2Vendor\Module\Model\Indexer\UrlRewrites' is not accepted by the pattern '[a-zA-Z\\]+'.
Line: 3

Element 'indexer', attribute 'class': 'Mage2Vendor\Module\Model\Indexer\UrlRewrites' is not a valid value of the atomic type 'classType'.
Line: 3

Note

If you bypass the first issue by editing Magento/Framework/Indexer/etc/indexer.xsd
the same issue happens with the mview.xml file.

Running data recurring...The XML in file "/root/app/code/Mage2Vendor/Module/etc/mview.xml" is invalid:
Element 'view', attribute 'class': [facet 'pattern'] The value 'Mage2Vendor\Module\Model\Indexer\UrlRewrites' is not accepted by the pattern '[a-zA-Z\\]+'.
Line: 3

Element 'view', attribute 'class': 'Mage2Vendor\Module\Model\Indexer\UrlRewrites' is not a valid value of the atomic type 'classType'.
Line: 3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions