Question:

Twig dump not working (PHP Warning: Leaked 2 hashtable iterators )

Lucas: 18 January 2022

I'm trying to create a custom markup for a views-block. What I want to do is similar to what someone is trying to do here (How to create a custom markup for a views-block? (https://drupal.stackexchange.com/questions/163786/how-to-create-a-custom-markup-for-a-views-block/182826#182826)).

My view-block has 3 items and I want to create a template where I can individually place them using HTML code. At the moment it just gets rendered from {{ content }} in my block--views-block--latest-block-1.html.twig. I guess I'd need to check how the three elements are stored in the content so that I can individually place them in my HTML markup.

The Twig dump function however doesn't seem to work. I get the following error message when loading my webpage:

PHP message: PHP Warning: Leaked 2 hashtable iterators in Unknown on line 0

What's going on?

Answer:
Cameron: 18 January 2022

Probably because there are some recursive data structures in there. Try installing kint from the devel project, I'm not sure right now if it replaces dump() or if it provides an alternative kint() but one of those should give you much better output.