Infinite loop inside getEntityImageData

Created on 6 December 2024, 16 days ago

Problem/Motivation

When embedding image in the sitemaps, a problem occurs if you have medias relating to other medias. The problem occurs inside getEntityImageData where it keeps calling in the loop the function recursively.

Steps to reproduce

I am embedding images in my sitemap and i have a field linking to a youtube video media. That media has a field named "field_related_videos" which links to other youtube video medias. That function keeps calling itself and the sitemap crashes.

Proposed resolution

A solution could be to either make some fields ignored, like maybe a configuration a field with a list of one field per line that would be ignored when crawling the medias.

Another solution could be to add a maximum depth in the recursion to prevent this kind of issue, but I think this solution is more a bandaid than a real fix.

🐛 Bug report
Status

Active

Version

4.2

Component

Code

Created by

🇨🇦Canada mathg16

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @mathg16
  • 🇩🇪Germany gbyte Berlin

    Please open bug reports only against the dev version.

    I feel like your second solution would be a good emergency break for these relatively rare set-ups. The first solution seems to require too much additional complexity.

    Feel free to provide an MR and optionally a test for this.

  • 🇩🇪Germany gbyte Berlin
Production build 0.71.5 2024