Sulu: File name "search" activates WebsiteSearchController

Created on 8 Sep 2020  路  3Comments  路  Source: sulu/sulu

| Q | A
| --- | ---
| Sulu Version | 2.1.2

Actual Behavior

Sulu\Component\Rest\Exception\MissingParameterException:
Missing parameter q in Sulu\Bundle\SearchBundle\Controller\WebsiteSearchController

  at vendor/sulu/sulu/src/Sulu/Component/Rest/RequestParametersTrait.php:38
  at Sulu\Bundle\SearchBundle\Controller\WebsiteSearchController->getRequestParameter(object(Request), 'q', true)
     (vendor/sulu/sulu/src/Sulu/Bundle/SearchBundle/Controller/WebsiteSearchController.php:69)
  at Sulu\Bundle\SearchBundle\Controller\WebsiteSearchController->queryAction(object(Request))
     (vendor/symfony/http-kernel/HttpKernel.php:158)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:80)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:201)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (public/index.php:63)

Expected Behavior

show the image that was requested via /build/website/icons/search.svg

Steps to Reproduce

In a Sulu System call any file in any subfolder named "search" (+ any extension or none at all)

Possible Solutions

No concrete ideas, but the WebsiteSearchController should not respond every time a file has the name "search". Workaround for me was to suffix all icons with '-icon'

Bug

All 3 comments

Hello @saphrus,

Thank you for report this issue.

for static images PHP should never be called. So if you created the /build/website/icons/search.svg in public/build/website/icons/search.svg inside your project and its not returned by your webserver its an error in your Vhost Configuration.

If you have a route which does return your image make at current state sure that its registered before the following route:

https://github.com/sulu/skeleton/blob/23e64dcd12e72668b6c6f4d8785a843f8ecd8304/config/routes/sulu_website.yaml#L4-L6

This issue will be fixed by #5428.

Thanks a lot!

Thanks for reporting! The route problem should hopefully be fixed by #5498

Was this page helpful?
0 / 5 - 0 ratings