Skip to content
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

Can't Create URLs Shorter than Three Characters #2910

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

Comments

Projects
8 participants
@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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

shiftedreality commented Jan 14, 2016

Hi @astorm

Is it still an issue for you?

@antonkril

This comment has been minimized.

Copy link
Contributor

antonkril commented Jan 25, 2016

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

@shiftedreality

This comment has been minimized.

Copy link
Member

shiftedreality commented Jan 26, 2016

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

@astorm

This comment has been minimized.

Copy link
Author

astorm commented May 9, 2016

Any update on this issues?

/cc @piotrekkaminski

@piotrekkaminski

This comment has been minimized.

Copy link
Contributor

piotrekkaminski commented May 10, 2016

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

@cspruiell

This comment has been minimized.

Copy link
Contributor

cspruiell commented May 11, 2016

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.

@cspruiell cspruiell closed this May 11, 2016

@magento-engcom-team magento-engcom-team moved this from TODO to Done in branch [2.3-develop] Sep 12, 2017

magento-engcom-team pushed a commit that referenced this issue Jul 26, 2018

Merge pull request #2910 from magento-thunder/MAGETWO-93758
[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
You can’t perform that action at this time.