From 5129afac039ddc9519ddbb9d74557f74f96e8870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Weso=C5=82owski?= Date: Sat, 27 Oct 2018 11:12:04 +0200 Subject: [PATCH] iri based on value from persister --- src/EventListener/WriteListener.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/EventListener/WriteListener.php b/src/EventListener/WriteListener.php index 3c9e6364cde..45c902d416d 100644 --- a/src/EventListener/WriteListener.php +++ b/src/EventListener/WriteListener.php @@ -59,7 +59,8 @@ public function onKernelView(GetResponseForControllerResultEvent $event) @trigger_error(sprintf('Returning void from %s::persist() is deprecated since API Platform 2.3 and will not be supported in API Platform 3, an object should always be returned.', DataPersisterInterface::class), E_USER_DEPRECATED); } - $event->setControllerResult($persistResult ?? $controllerResult); + $controllerResult = $persistResult ?? $controllerResult; + $event->setControllerResult($controllerResult); if (null !== $this->iriConverter) { $request->attributes->set('_api_write_item_iri', $this->iriConverter->getIriFromItem($controllerResult));