- Issue created by @mattlc
- 🇫🇷France Grimreaper France 🇫🇷
Hi,
Thanks a lot for the report.
But I can't reproduce, is it because my test environment is on D10?
In the Redirect event subscriber what are the variables values that it triggers a redirect?
- 🇫🇷France goz
I confirm the issue with D11, and i'm using :
ui_patterns : 2.0.0-rc2
ui_styles: 8.x-1.15After applying patch, i can add section to my layout.
- 🇫🇷France goz
My bad, i reproduce in D10.4 and D10.3.
In ui_style.routing.yml file, route is defined with .css extension
ui_styles.stylesheet: path: '/ui_styles/stylesheet.css' defaults: _controller: 'Drupal\ui_styles\Controller\StylesheetController::generateStylesheet' _title: 'UI Styles CSS generator' requirements: _permission: 'access content'
In Nginx, the following configuration add ?q= because of .css extension.
location @rewrite { rewrite ^/(.*)$ /index.php?q=$1; } location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|eot|ttf|woff|woff2)$ { try_files $uri @rewrite; }
So in web/modules/contrib/redirect/src/EventSubscriber/RouteNormalizerRequestSubscriber.php, at the end of onKernelRequestRedirect method, redirect_uri is
/ui_styles/stylesheet.css?q=/ui_styles/stylesheet.css&prefix....
so redirect module redirect to this url.
?q should not be there, but it's caused by nginx configuration and because it's not a real CSS file but generated on the fly by controller.
Renaming controller path to something without .css extension solve the issue
- 🇫🇷France Grimreaper France 🇫🇷
MR rebased and updated.
@pierre, can you test with Drush webserver please?