Fix action templates for url option#17926
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
❌ Preview Environment deleted from BunnyshellAvailable commands:
|
733d1e5 to
77c7ae5
Compare
| {% set id = options.link.parameters['id']|default(data.id) %} | ||
|
|
||
| {% set path = options.link.url|default(path(options.link.route|default(grid.requestConfiguration.getRouteName('delete')), options.link.parameters|default({'id': id}))) %} | ||
| {% if options.link.url is defined %} |
There was a problem hiding this comment.
Pointing out just in case, since we have disabled state now,
{% if options.link.url is defined %}will crash if options or options.link are undefined.
Personally, I would rather not support this case and receive the error as is if options are configured badly (If it's even possible with options validation in grid configuration).
There was a problem hiding this comment.
are you sure it will crash? I'm not sure at all.
There was a problem hiding this comment.
Could you check that to be sure? 🤔
There was a problem hiding this comment.
According to docs -- yes,
https://twig.symfony.com/doc/3.x/tests/defined.html

but in playground looks alright
src/Sylius/Bundle/AdminBundle/templates/shared/grid/action/show.html.twig
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/AdminBundle/templates/shared/grid/action/update.html.twig
Outdated
Show resolved
Hide resolved
77c7ae5 to
e10dc62
Compare
|
Thank you Loic! 🎉 |
More details on related ticket.