stakx-io/stakx

dump() crashes on possible recursion problem

Closed this issue · 1 comments

{% set functions = collections.bzfs_api_functions | group('category') %}

{{ dump(functions) }}

Given a collection of content items and using the group filter, stakx crashes for a reason that requires further investigation.

This was happening because Content Items have a reference to the parent Dynamic PageView that it belongs to. The Dynamic PageViews had a reference to all its children and this lead to recursion for dump().

Implementing the __debugInfo() magic method allows us to output far more useful information and it'll avoid the recursion. Now, jailed documents will output the result of jailed functions and Front Matter which is all that's accessible through Twig anyways.