Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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 Užkuras |
#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
apadernoPlease provide more details about the error you are getting. What were you doing before to get that exception?
Comment #3
sriharsha.uppuluri CreditAttribution: sriharsha.uppuluri at Azri Solutions 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 CreditAttribution: sriharsha.uppuluri at Azri Solutions commentedComment #5
swentel CreditAttribution: swentel as a volunteer commentedHmm, I can't reproduce the error. Are you entering something specific in the path or so ?
Comment #6
swentel CreditAttribution: swentel as a volunteer 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 CreditAttribution: sriharsha.uppuluri at Azri Solutions 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 CreditAttribution: sriharsha.uppuluri at Azri Solutions commentedWhen I disable clean URL's configuration in settings its creating without any problem.
Comment #9
swentel CreditAttribution: swentel at eps & kaas for MuseScore commentedI was finally able to reproduce this and fix it. Patch attached, but already committed and pushed!
Comment #11
swentel CreditAttribution: swentel at eps & kaas for MuseScore commentedComment #12
Evaldas UžkurasThe 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 CreditAttribution: Sagar Ramgade as a volunteer and at Trigyn Technologies Ltd commentedI agree with @Evaldas Užkuras, patch attached removes the extra non-required code.
Comment #14
swentel CreditAttribution: swentel at eps & kaas for MuseScore 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 UžkurasMade 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 CreditAttribution: swentel at eps & kaas for MuseScore commentedcommitted and pushed, thanks!