ZF2-76: Zend\View\Helper\Partial clears variables in the view if cloned from

Description

Page is setup layout ->render('header.phtml') ->content ->render('footer.phtml')

content ->partial('table.phtml, $data)

When this renders view assigned variables will no longer be available in header.phtml or anywhere else, removing the call to partial will keep everything in tact. Further removing $view->vars()->clear(); from Zend\View\Helper\Partial will keep everything in tact. Obviously it's supposed to remove the variables from the cloned view and only give access to the passed variables, however it appears like it clears also the variables in the view object it originally cloned.

Comments

Replacing $view->vars()->clear(); with $view->setVars(new \Zend\View\Variables()); seems to work as expected.

Whe had this issue and sent this PR for it (https://github.com/zendframework/zf2/pull/577).

This issue is probably already fixed.

Confirmed that this has been resolved.