Skip to content

Can't Create URLs Shorter than Three Characters #2910

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
astorm opened this issue Jan 7, 2016 · 9 comments
Closed

Can't Create URLs Shorter than Three Characters #2910

astorm opened this issue Jan 7, 2016 · 9 comments

Comments

@astorm
Copy link

astorm commented Jan 7, 2016

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.

@Vinai Vinai added the PS label Jan 7, 2016
@namluu
Copy link

namluu commented Jan 7, 2016

It's not a URL's problem. The route id doesn't allow dashes but frontName does, you can set:
<route id="helloworld" frontName="hello-world">

@astorm astorm changed the title Can't Create URLs with Single Dashes Can't Create URLs Shorter than Three Characters Jan 7, 2016
@astorm
Copy link
Author

astorm commented Jan 7, 2016

@namluu You are correct! You can have dashes in the frontName. Useful, thanks! Updated the bug the reflect my annoyance on the limits of three character URLs instead :)

@ghost
Copy link

ghost commented Jan 8, 2016

@astorm Thanks for pointing this out. I updated the routing topic with character restrictions.

BTW, in your example XML, you're using a path to the XSD instead of a URN.

@shiftedreality
Copy link
Member

Hi @astorm

Is it still an issue for you?

@antonkril
Copy link
Contributor

Route Front Name has this limitation by mistake. It should be fixed.

@shiftedreality
Copy link
Member

Internal ticket MAGETWO-48333 was created to fix this issue.

@astorm
Copy link
Author

astorm commented May 9, 2016

Any update on this issues?

/cc @piotrekkaminski

@piotrekkaminski
Copy link
Contributor

This is not yet fixed. Increased priority but I don't expect the fix in nearest release.

@cspruiell
Copy link
Contributor

This was fixed in the scope of another ticket (MAGETWO-48495) and is in the latest develop branch. It will be included in the next release.

magento-engcom-team pushed a commit that referenced this issue Jul 26, 2018
[thunder] MAGETWO-93758: [Backport 2.2.x] Make cron:run CLI command react on cron disable configuration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants