TYPO3-Headless / headless

TYPO3 Headless JSON API providing content for PWA application (e.g. javaScript apps like nuxt-typo3)
https://t3headless.io
GNU General Public License v2.0
156 stars 57 forks source link

Endless loop in CType `menu_section` #715

Closed kitzberger closed 4 months ago

kitzberger commented 5 months ago

Describe the bug

There seems to be a endless loop for CType menu_section when rendering itself.

To Reproduce Steps to reproduce the behavior:

  1. Create a CType menu_section on any page
  2. Make sure it's got sectionIndex=1
  3. Try to render the frontend

Expected behavior A clean section index being rendered.

Error Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 36864 bytes) in /var/www/vendor/typo3/cms-frontend/Classes/ContentObject/Menu/MenuContentObjectFactory.php on line 52

TYPO3 version and TYPO3 Headless version TYPO3 12 / EXT:headless 4.x

Additional context

Problem is that the items of the section index are all being fetched via FriendsOfTYPO3\Headless\DataProcessing\DatabaseQueryProcessor and rendered as tt_content is defined. And that's the cause of the endless loop.

Suggestion

Only render those fields of the items that are really necessary: uid and header that is?

tt_content.menu_section.fields.content.fields.menu.dataProcessing.10.dataProcessing.20 {
        fields {
                  uid = TEXT
                  uid.field = uid
                  header = TEXT
                  header.field = header
        }
}