Skip to content

Can't Create URLs Shorter than Three Characters #2910

@astorm

Description

@astorm

If I attempt to create a new route for a module, and that module's front name is less than three characters

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd">
    <router id="standard">
        <route id="hello-world" frontName="hw">
            <module name="Pulsestorm_HelloPestle"/>
        </route>
    </router>
</config>

Magento's XML validator complains

Element 'route', attribute 'frontName': [facet 'pattern'] The value 'hw' is not accepted by the pattern '[A-Za-z0-9_\-]{3,}'.

It looks like the regular expressions for validating this element ([A-Za-z0-9_]{3,}) demands a frontName be at least three characters.

Based on the behavior of other PHP frameworks (which allow segments shorter than three characters), this is a bug and should be fixed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions