monsieurbiz / SyliusSearchPlugin

A search plugin using Elasticsearch for Sylius
MIT License
45 stars 38 forks source link

Variable "event_prefix" does not exist. #203

Closed vasilvestre closed 9 months ago

vasilvestre commented 9 months ago

When rendering admin settings and opening SyliusSearchPlugin, a template miss a variable.

image

Versions

package version
Symfony 5.4
Sylius 1.12.13
SyliusSearch 2.1.8
SyliusSettings 1.1.1
delyriand commented 9 months ago

Hi @vasilvestre!

This error is not related to the Search plugin, nor is it totally related to the Settings plugin…

You have overridden the template to add {{ sylius_template_event([event_prefix ~ '.buttons'..., except that this template can be used without the variable being defined.

For example, you should get the same error if you try to edit the addresses of an order (example: /admin/orders/XXX/edit).

One solution would be to define a default value just in case:

{{ sylius_template_event([event_prefix|default('global' ~ '.buttons'...
vasilvestre commented 9 months ago

I guess a coffee was required

Sorry for the noise 😅

delyriand commented 9 months ago

you will buy me a beer during the afup day 🍻 ;)