- Issue created by @luke.leber
- πΊπΈUnited States luke.leber Pennsylvania
Let's try this, to get started...
- last update
about 1 year ago 5 pass, 2 fail - last update
about 1 year ago 10 pass - last update
about 1 year ago 10 pass - πΊπΈUnited States luke.leber Pennsylvania
Fix coding standard violation.
- last update
about 1 year ago 10 pass - last update
about 1 year ago 10 pass - Status changed to Needs review
about 1 year ago 3:54pm 21 October 2023 - πΊπΈUnited States luke.leber Pennsylvania
Setting to NR; also requires manual testing against real sites.
- π²π½Mexico Alan Delval
Did not work. Tested and found that works sometimes due to how HttpKernel works. The first request file is created and returns an instance of
Response,
afterward it returns an instance ofBinaryFileResponse
because the file already exists on file system.// Since Drupal 10, assets are lazily constructed. $sub_request = Request::create($asset['data']); $raw_request = $this->httpKernel->handle($sub_request, HttpKernelInterface::SUB_REQUEST); if ($raw_request instanceof \Symfony\Component\HttpFoundation\BinaryFileResponse) { $css_request = $raw_request->getFile()->getContent(); } else { $css_request = $raw_request->getContent(); } $css .= $css_request;
- πΊπΈUnited States luke.leber Pennsylvania
Thanks for the manual test!
It sounds like it's going to be hard to kernel test this...almost sounds race condition-ny...maybe we'll have to go heavier into functional test territory to land this.
- Status changed to Needs work
about 1 year ago 12:18am 9 November 2023 - π¬π§United Kingdom catch
I think it would be more maintainable long term to copy some of the logic in AssetControllerBase::deliver() (can be massively slimmed down because it doesn't need all the request validation) - build what would have been the filename contents from the contents of the $css_assets array, and store it in the Drupal object cache rather than as a file.