Project

General

Profile

Actions

Bug #82736

closed

Nesting level too deep - recursive dependency? in Extbase/SignalSlot/Dispatcher.php

Added by David Lobato over 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2017-10-11
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

When connecting a signal with a slot, being the slot an object instance with complex structure (many nested elements), \TYPO3\CMS\Extbase\SignalSlot\Dispatcher->connect throws the exception:

Fatal error: Nesting level too deep - recursive dependency?

when checking if signal-slot connection already exists:

if (!is_array($this->slots[$signalClassName][$signalName]) || !in_array($slot, $this->slots[$signalClassName][$signalName])) {
   $this->slots[$signalClassName][$signalName][] = $slot;
}

The exceptions occurs at in_array(...), which happens when connecting the second (and next) slot to the same signal.

This happens because slot is not strictly compared when doing the in_array search as mentioned here: https://stackoverflow.com/questions/3834791/fatal-error-nesting-level-too-deep-recursive-dependency

Setting the strict flag on the in_array solves the problem:

if (!is_array($this->slots[$signalClassName][$signalName]) || !in_array($slot, $this->slots[$signalClassName][$signalName], true)) {
   $this->slots[$signalClassName][$signalName][] = $slot;
}
Actions #1

Updated by Gerrit Code Review over 6 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54372

Actions #2

Updated by Gerrit Code Review over 6 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54372

Actions #3

Updated by Georg Ringer over 6 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #4

Updated by David Lobato over 6 years ago

Georg Ringer wrote:

Applied in changeset 41913e4034f1e40ce9cd8b5ec5577af97865af78.

Any hope to see this change soon on 8.7?

Actions #5

Updated by Gerrit Code Review over 6 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55188

Actions #6

Updated by Gerrit Code Review over 6 years ago

Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55189

Actions #7

Updated by Gerrit Code Review over 6 years ago

Patch set 2 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55189

Actions #8

Updated by Georg Ringer over 6 years ago

  • Status changed from Under Review to Resolved
Actions #9

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF