File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 11# CHANGELOG
22
3+ ## 0.4.4
4+
5+ * ` ResourceResponseListener ` only modifies response if it is a ResourceViewModel
6+
37## 0.4.3
48
59* ` isRootTemplate ` now work even if you have called the ` renderResource ` helper inside a view
Original file line number Diff line number Diff line change 2222use Zend \EventManager \EventManagerInterface ;
2323use Zend \Http \Response as HttpResponse ;
2424use Zend \Mvc \MvcEvent ;
25+ use ZfrRest \View \Model \ResourceViewModel ;
2526
2627/**
2728 * HttpExceptionListener
@@ -48,9 +49,13 @@ public function attach(EventManagerInterface $events)
4849 */
4950 public function finishResponse (MvcEvent $ event )
5051 {
51- $ response = $ event ->getResponse ();
52+ $ response = $ event ->getResponse ();
53+ $ viewModel = $ event ->getViewModel ();
5254
53- if (!$ response instanceof HttpResponse || null !== $ event ->getParam ('exception ' )) {
55+ if (!$ response instanceof HttpResponse
56+ || null !== $ event ->getParam ('exception ' )
57+ || !$ viewModel instanceof ResourceViewModel
58+ ) {
5459 return ;
5560 }
5661
You can’t perform that action at this time.
0 commit comments