Infinite loop issue

Created on 10 January 2023, over 1 year ago
Updated 16 January 2023, over 1 year ago

Problem/Motivation

Under some circumstances, the tree view can end up in an infinite loop, causing the page to generate a timeout.

Steps to reproduce

The steps that lead to the error are not clear, here are some crumbs :

In \Drupal\views_tree\ViewsResultTreeValues::setTreeValues() if when we call $this->findRowByParent($result, $current_row->views_tree_parent); $result and $current_row->views_tree_parent have the same value, you'll end up in an infinite loop because we always enter in the if statement.

Proposed resolution

Two options i'd say:
1/ Add a condition to the while to limit the depth to the number if items in $result. We can't go deeper than that.
2/ Add a test to prevent an item for being it's own parent when the keys are normalized.

A third option could be to do both.

πŸ› Bug report
Status

RTBC

Version

2.0

Component

Code

Created by

πŸ‡«πŸ‡·France Artusamak Bzh

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.69.0 2024