Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Display the Welcome Page when there is no homepage defined#26041
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
nicolas-grekas commentedFeb 4, 2018
I'm +1 on the intend. |
sroze commentedFeb 4, 2018
Definitely 👍 |
yceruto commentedFeb 4, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Hey Javier, I like your proposal and in the same direction we might need to make some additional changes: The phrase
According to your idea, this part should also be updated: symfony/src/Symfony/Component/Routing/Matcher/UrlMatcher.php Lines 79 to 81 inae25291
Related fixtures that require updating (files): symfony/src/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php Lines 423 to 429 inae25291
In the other hand, I have a concern now about the name/description of this exception, because it does not fit his new scenario, i.e. it'll be thrown even with routes configuration: symfony/src/Symfony/Component/Routing/Exception/NoConfigurationException.php Lines 14 to 21 inae25291
Do you think we can add another exception NoRootConfiguration extends NoConfiguration and throw it instead? In that case we might need deprecate theNoConfiguration class or use it only when'' === $code:$code .=" if ('/' ===\$pathinfo) {\n";if ('' ===$code) {$code .=" throw new Symfony\Component\Routing\Exception\NoConfigurationException();\n";}else {$code .=" throw new Symfony\Component\Routing\Exception\NoRootConfigurationException();\n";}$code .=" }\n"; |
nicolas-grekas commentedFeb 11, 2018
I think it doesn't matter much, let's keep things simple IMHO |
nicolas-grekas commentedFeb 19, 2018
Status: needs work |
ChrisWMichel commentedFeb 23, 2018
So is there a quick fix? |
sunnz commentedMar 6, 2018
I found this affects 4.0 too. (I just started following the getting started guide with 4.0.) But I see that this is about the 3.4 branch and the other 4.0 pull requests and issues are closed... so I am wondering if this fix will apply to 4.x too? |
javiereguiluz commentedMar 9, 2018
@yceruto I'm sorry but I don't know how to make the changes you mentioned in |
yceruto commentedMar 9, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
javiereguiluz commentedMar 11, 2018
@yceruto thanks for your great help! I made the change and tests are now green. Ready for review! |
fabpot commentedMar 11, 2018
Thank you@javiereguiluz. |
… (javiereguiluz)This PR was squashed before being merged into the 3.4 branch (closes#26041).Discussion----------Display the Welcome Page when there is no homepage defined| Q | A| ------------- | ---| Branch? | 3.4| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |symfony/symfony-docs#9178| License | MIT| Doc PR | -In 3.4 we added a trick to display the Welcome Page when the user browses `/` and there are no routes defined. However, when using the `website-skeleton` (which is what most newcomers use ... and they are the ones that mostly need the "Welcome Page") the premise about *"no routes are defined"* is never true and the Welcome Page is never shown (seesymfony/symfony-docs#9178 for one of the multiple error reports we've received).So, I propose to make this change to always define the "Welcome Page" as the fallback:* If no routes are defined for `/`, the Welcome Page is displayed.* If there is a route defined for `/`, this code will never be executed because it's the last condition of the routing matcher.Commits-------5b0d934 Display the Welcome Page when there is no homepage defined
settermjd commentedMar 12, 2018
Hey@javiereguiluz, will this be ported to the 4.0 branch? |
javiereguiluz commentedMar 12, 2018
Yes. Pull requests are periodically merged from lower to upper maintained branches, so this will end up in 4.0 and master too. Here is the list of maintained branches:https://symfony.com/roadmap |
mario6097 commentedMar 22, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Fedora 26, Symfony 4.0., just installed (by |
yceruto commentedMar 22, 2018
@mario6097 It's already fixed, butit has not been released yet. |
idildin commentedApr 18, 2018
I use jms/i18n-routing-bundle and update symfony to 3.4.7 and i have problem with this feature. |
odie2 commentedApr 26, 2018
Same like@idildin. composer.json
routing.yml config.yml
My question is: should I wait to fix by JMS I18N Routing bundle or by Symfony or is there any workaround to force default language redirect? |
nicolas-grekas commentedApr 26, 2018
Please open dedicated issues instead: you won't get any attention by commenting on closed ones. |
mickaelandrieu commentedMay 29, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Also, this is a BC for everyone involving in progressive migration to Symfony =>https://github.com/PrestaShop/PrestaShop/blob/develop/admin-dev/index.php#L87 I can't imagine what motivated you to change the behavior in an LTS :/ Any workaround? EDIT: nevermind, it's already fixed with the latest 3.4, thanks :) |
In 3.4 we added a trick to display the Welcome Page when the user browses
/and there are no routes defined. However, when using thewebsite-skeleton(which is what most newcomers use ... and they are the ones that mostly need the "Welcome Page") the premise about"no routes are defined" is never true and the Welcome Page is never shown (seesymfony/symfony-docs#9178 for one of the multiple error reports we've received).So, I propose to make this change to always define the "Welcome Page" as the fallback:
/, the Welcome Page is displayed./, this code will never be executed because it's the last condition of the routing matcher.