Problem/Motivation
The internal path has always been a part of front theme hook suggestions. The related issue (cause of this regression) instead, prematurely preempted detection of the front page to determine which arguments are passed to theme_get_suggestions(), which is where the actual --front suggestion addition lives.
Currently, there is an empty string in an array passed for front suggestions, which causes an improper theme hook suggestion:
<!-- FILE NAME SUGGESTIONS:
* html--front.html.twig
* html--.html.twig <----
x html.html.twig
-->
<!-- FILE NAME SUGGESTIONS:
* page--front.html.twig
* page--.html.twig <----
x page.html.twig
-->
Proposed resolution
system_theme_suggestions_html and system_theme_suggestions_page should simply pass the normally split internal path like every other page.
Remaining tasks
Create initial patch
- Create tests
User interface changes
None
API changes
None, fixes a regression to this API
Data model changes
None
Comments
Comment #2
markhalliwellComment #4
joelpittetI had to trim both right and left for the / because with a path of just '/' produced an empty result too.
Command line proof:
php -r "print_r(explode('/', ltrim('/', '/')));"This test does a node like path that is resolved to the home page (mocked with prophasize, thanks for help from @klausi).
Comment #6
lauriiiThis comment doesn't describe at all what is actually being tested. Beside that the patch looks good for me.
Comment #7
joelpittetThanks I forgot to change that from the test copied from above.
Comment #8
lauriiiThanks! For me this is RTBC.
Comment #10
catchNice that this actually simplifies the code and thanks for the test coverage.
Committed/pushed to 8.3.x, thanks!