Details
-
Bug
-
Resolution: Duplicate
-
High
-
None
-
2.2.2
-
None
Description
The customer got an exception when using ContentProxy object in the Twig template like above:
{{ render( controller( "ez_content:viewAction", { "locationId": someLocationId, "viewType": "sidebar", "params": { 'currentContent': content } } ) ) }}
Exception:
Error: Method eZ\Publish\Core\Repository\Values\Content\ContentProxy::__toString() must not throw an exception, caught Symfony\Component\Debug\Exception\ContextErrorException: Catchable Fatal Error: Object of class eZ\Publish\Core\Repository\Values\Content\Content could not be converted to string
The customer mentioned also that when they refactored template like this:
{{ render( controller( "ez_content:viewAction", { "locationId": someLocationId, "viewType": "sidebar", "params": { 'currentContentId': content.id } } ) ) }}
then issue doesn't appear anymore.
This issue has been discovered and reported by the customer during the migration to v2. Since the customer doesn't have this issue anymore it is not reported on the 3rd line but as a regular bug instead.