From c6c6ea40e8c4240ad36aa56d37807de18f15c5e8 Mon Sep 17 00:00:00 2001 From: Grzegorz Sadowski Date: Fri, 18 Jun 2021 09:15:00 +0200 Subject: [PATCH 1/2] Replace Sonata block events with Sylius template events --- src/Resources/config/app/config.yml | 13 +++++++++++++ src/Resources/config/services/listeners.xml | 10 ---------- .../views/Order/Admin/creditMemos.html.twig | 2 +- .../views/Order/Shop/creditMemos.html.twig | 2 +- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/Resources/config/app/config.yml b/src/Resources/config/app/config.yml index e6899189..ba75e351 100644 --- a/src/Resources/config/app/config.yml +++ b/src/Resources/config/app/config.yml @@ -135,6 +135,19 @@ sylius_grid: form_options: class: "%sylius.model.channel.class%" +sylius_ui: + events: + sylius.admin.order.show.summary: + blocks: + credit_memos: + template: '@SyliusRefundPlugin/Order/Admin/creditMemos.html.twig' + priority: 5 + sylius.shop.account.order.show.subcontent: + blocks: + credit_memos: + template: '@SyliusRefundPlugin/Order/Shop/creditMemos.html.twig' + priority: 5 + doctrine: dbal: types: diff --git a/src/Resources/config/services/listeners.xml b/src/Resources/config/services/listeners.xml index e254425a..4fd1f50f 100644 --- a/src/Resources/config/services/listeners.xml +++ b/src/Resources/config/services/listeners.xml @@ -15,15 +15,5 @@ - - - @SyliusRefundPlugin/Order/Shop/creditMemos.html.twig - - - - - @SyliusRefundPlugin/Order/Admin/creditMemos.html.twig - - diff --git a/src/Resources/views/Order/Admin/creditMemos.html.twig b/src/Resources/views/Order/Admin/creditMemos.html.twig index 496d2012..effe47c7 100644 --- a/src/Resources/views/Order/Admin/creditMemos.html.twig +++ b/src/Resources/views/Order/Admin/creditMemos.html.twig @@ -1 +1 @@ -{{ render(path('sylius_refund_order_credit_memos_list', {'orderId': block.settings.resource.id})) }} +{{ render(path('sylius_refund_order_credit_memos_list', {'orderId': order.id})) }} diff --git a/src/Resources/views/Order/Shop/creditMemos.html.twig b/src/Resources/views/Order/Shop/creditMemos.html.twig index ad7e2ab2..f2100ef2 100644 --- a/src/Resources/views/Order/Shop/creditMemos.html.twig +++ b/src/Resources/views/Order/Shop/creditMemos.html.twig @@ -1 +1 @@ -{{ render(url('sylius_refund_plugin_shop_order_credit_memos_partial', {'orderId': block.settings.order.id})) }} +{{ render(url('sylius_refund_plugin_shop_order_credit_memos_partial', {'orderId': order.id})) }} From f9db6ea21448ab347292211c839f637638d3a6e4 Mon Sep 17 00:00:00 2001 From: Grzegorz Sadowski Date: Fri, 18 Jun 2021 11:21:05 +0200 Subject: [PATCH 2/2] Add note about replacing Sonata events to UPGRADE file --- UPGRADE.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/UPGRADE.md b/UPGRADE.md index d989f93b..298499a8 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -73,6 +73,9 @@ + public function getProvinceCode(): ?string ``` +1. `sylius_refund_plugin.block_event_listener.account.order_show` and `sylius_refund_plugin.block_event_listener.order_show.credit_memos` + listeners have been replaced by `sylius_ui` configuration + ### UPGRADE FROM 1.0.0-RC.9 TO 1.0.0-RC.10 1. Support for Sylius 1.8 has been dropped, upgrade your application to [Sylius 1.9](https://github.com/Sylius/Sylius/blob/master/UPGRADE-1.9.md)