1

I try to extend SonataAdminBundle:CRUD:list_outer_rows_mosaic.html.twig Like this

# src/app/Resources/SonataAdminBundle/views/CRUD/list_outer_rows_mosaic.html.twig
{% extends 'SonataAdminBundle:CRUD:list_outer_rows_mosaic.html.twig' %}
{% block sonata_mosaic_background %}
    {% if admin.media(object) %}
        <img src="{{ admin.media(object) }}"/>
    {% else %}
        <img src="{{ meta.image }}" alt="" />
    {% endif %}
{% endblock %}

But I'm getting Maximum function nesting level of '256' reached, aborting! error. Maybe you guys have ideas why?

Andrius
  • 320
  • 4
  • 13

1 Answers1

1

This is a well-knowm XDebug error message. You may want to raise your XDebug xdebug.max_nesting_level value. If this does not solve your problem, it probably means there is some kind of recursivity issue. Please try setting it to 512 first though.

Community
  • 1
  • 1
greg0ire
  • 21,120
  • 15
  • 68
  • 95
  • Increased value, error still there `Maximum function nesting level of '1000' reached, aborting!` – Andrius Apr 24 '17 at 14:06
  • Then you do have a recursivity issue, I guess. You should edit your question and add a Stack Trace into it, there will probably be a cycle in the Stack Trace. – greg0ire Apr 24 '17 at 14:10
  • Are you getting this while debugging with breakpoints or all the time? I've had this problem while debugging and it was specific to my case where I've had the project running inside of a Docker container. My project however was run in PhpStorm locally outside of Docker and I've had deployment set up to the Docker machine. When some Debugging mappings in PhpStorm were not set properly (or I've been missing the cache files from Docker container in my local project directory) then I would get this max function nesting level reached error. After fixing the mappings and downloading cache, it works. – Najki Apr 26 '17 at 06:13