The website encountered an unexpected error. Please try again later.
LogicException: Route pattern "/search-items/test/{keys}/{keys}" cannot reference variable name "keys" more than once. in Symfony\Component\Routing\RouteCompiler::compilePattern() (line 102 of vendor/symfony/routing/RouteCompiler.php).
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | unable_to_create_more-2696607-15.patch | 697 bytes | evaldas.uzkuras |
| #13 | search_api_pages-Unable_to_create_more_pages-2696607-13-D8.patch | 1.12 KB | sagar ramgade |
| #9 | 2696607-9.patch | 724 bytes | swentel |
| #3 | search-page-test-WSOD.png | 142.77 KB | sriharsha.uppuluri |
Comments
Comment #2
avpadernoPlease provide more details about the error you are getting. What were you doing before to get that exception?
Comment #3
sriharsha.uppuluri commentedI have created one search page as "search-page" and another as "search-page-test". After creation of second search page "search-page-test" getting an error as attached.
Comment #4
sriharsha.uppuluri commentedComment #5
swentel commentedHmm, I can't reproduce the error. Are you entering something specific in the path or so ?
Comment #6
swentel commentedOk, I think I see the problem: you're probably entering "search-page/{keys}" as the path. But you can't add {keys}, that's going to clash with symfony, and it's not necessary either.
Comment #7
sriharsha.uppuluri commentedI have just given
in path. Getting error message as search-test/{keys}/{keys} is it creating two keys for second search page.
Comment #8
sriharsha.uppuluri commentedWhen I disable clean URL's configuration in settings its creating without any problem.
Comment #9
swentel commentedI was finally able to reproduce this and fix it. Patch attached, but already committed and pushed!
Comment #11
swentel commentedComment #12
evaldas.uzkurasThe patch, which is committed, is bad and makes other problems.
Now there are this if statement.
it is equal to
and it rewrites previously declared $path variable.
My proposed solution is to remove that if statement and just change one line
- $default_path = $search_api_page->getPath();
+ $path = $search_api_page->getPath();
Comment #13
sagar ramgade commentedI agree with @Evaldas Užkuras, patch attached removes the extra non-required code.
Comment #14
swentel commentedWhat's the other problem ?
As confusing as it looks, there's actually a case in multilingual sites where the config override returns null. Granted, they all use the same variable name, so it could be made more clear. Reverting would break it again, so the patch in #13 is wrong.
Closing for now. Please open an issue if there are other bugs, but other than that it confuses, nothing is actually wrong with it.
Comment #15
evaldas.uzkurasMade some testings and found. that now the paths is not generated for languages.
Then using Configuration translation and having more then 1 language it is possible to enter search page path for each language.
And now the default path is used.
It's because my early mentioned if statement always overrides $path with default value, instead of keeping one, that was returned from language config override.
Adding patch, which fixes this problem.
Comment #17
swentel commentedcommitted and pushed, thanks!