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
Resource route length > 32 characters throws preg_match() errror. #1001
Comments
That's a Symfony thing. You can file an issue on their repository for their routing component asking for this. |
I've opened an issue in the Symfony repository: symfony/symfony#8933 We're also looking into ways to work around or correct this problem. |
@taylorotwell Is it rally a Symfony issue ? From a quick look, |
Master branch isn't... 4.0 branch is. @stof |
Looks like this is being pushed back up as a Laravel specific issue on how it uses Symfony's routing. We'll look into this further to see what can be done on L4's side and offer a pull request if we find an elegant solution. Otherwise, for now, we're just making sure slugs are never over 32 characters. |
Having the same problem, stumbled upon the Symfony issue @thinksaydo created, now back over here. @taylorotwell can you re-open this please? |
+1 on L4.2 |
4.2 isn't supported |
tks, i will try another solution. |
This issue still exists in Laravel 5.1.10. When using long resource names, the It would be nice to be able to set the preferred placeholder names in the resource options and/or making the Just putting this here instead of creating a new issue directly to check if it's something that will be fixed as it has been in since L4. |
Still exists in Laravel 5.1.24 (LTS). |
Bumped into this issue as well today (Laravel 5.1.26). Ball is in your court laravel. |
If were were to "fix" this, we still wouldn't allow more than 32 characters. We'd just change the warning into an exception. |
Per http://pcre.org/current/doc/html/pcre2pattern.html#SEC16 PCRE sub-patterns cannot be longer than 32 characters, so there's unfortunately nothing that Symfony can do about this. Their comment on this issue: symfony/symfony#8933 (comment) states "[Laravel] should allow you to decouple the url prefix and the placeholder name." which could be a useful work-around. Probably the real issue here is that running into the 32 character limit is surprise and that the exception thrown is from far enough down the call graph and so it looks like a bug in Laravel, even though it really isn't. Either way you slice it, the solution is to use a shorter sub-pattern name, either through shortening the argument to |
If this is just an issue with the route parameter, placeholder, we can now change that via the options array to |
When I try to delete a specified resource using a uri that is greater than 32 characters the following error is encountered:
My defined route:
If I shorten "salesorderlinedetaildepartmentemployees" to "salesorderlinedetaildepartmentem" everything executes just fine.
Requested solution: Extend how long the resource route uri can be.
The text was updated successfully, but these errors were encountered: