Bug #77645

Closures in SignalSlot\Dispatcher can cause troubles

Added by Benjamin Serfhos over 3 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2016-08-26
Due date:
% Done:

100%

TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Hi,

While connecting a quick SignalSlot to the Dispatcher using closure this can cause page rendering problems.

How to reproduce:

\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\SignalSlot\\Dispatcher')->connect(
    TYPO3\CMS\Core\Tree\TableConfiguration\TableConfiguration\DatabaseTreeDataProvider::class,
    \TYPO3\CMS\Core\Tree\TableConfiguration\DatabaseTreeDataProvider::SIGNAL_PostProcessTreeData,
    function(DatabaseTreeDataProvider $dataProvider, $treeData) {
       // my quick changes
    }
);

Now add a Text with Image and an plugin which is an USER_INT.
The text with image load an FAL image in cObj, the USER_INT tries to serialize the cObj.

This results in the error:
Serialization of 'Closure' is not allowed

I do not mind solving this issue myself, however I don't know on what level I should fix this.

1) Make sure cObj is serializable (using $this->cObj->setCurrentFile(null); at the end of \TYPO3\CMS\CssStyledContent\Controller\CssStyledContentController::render_textpic())

2) Make sure Closures are not allowed in signal slots (using validation in connect())

Kind regards,
Benjamin


Related issues

Related to TYPO3 Core - Bug #64916: Avoid serialization of some members of ContentObjectRenderer Closed 2015-02-06
Related to TYPO3 Core - Bug #81866: Regression: css_styled_content does no longer render image captions Closed 2017-07-14

Associated revisions

Revision d52c0d6b (diff)
Added by Benjamin Serfhos over 2 years ago

[BUGFIX] Unset current file in generic Content Object Renderer

When function is done, reset current file for further processing

Resolves: #77645
Releases: master, 8.7, 7.6
Change-Id: Ibae2e3221c51c8cb45f92b0bc7dbe395cc809605
Reviewed-on: https://review.typo3.org/49616
Tested-by: TYPO3com <>
Reviewed-by: Benjamin Serfhos <>
Tested-by: Benjamin Serfhos <>
Reviewed-by: Markus Klein <>
Reviewed-by: Elmar Hinz <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>

Revision 3bca59d4 (diff)
Added by Benjamin Serfhos over 2 years ago

[BUGFIX] Unset current file in generic Content Object Renderer

When function is done, reset current file for further processing

Resolves: #77645
Releases: master, 8.7, 7.6
Change-Id: Ibae2e3221c51c8cb45f92b0bc7dbe395cc809605
Reviewed-on: https://review.typo3.org/52811
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>

Revision 4dc552d4 (diff)
Added by Benjamin Serfhos over 2 years ago

[BUGFIX] Unset current file in generic Content Object Renderer

When function is done, reset current file for further processing

Resolves: #77645
Releases: master, 8.7, 7.6
Change-Id: Ibae2e3221c51c8cb45f92b0bc7dbe395cc809605
Reviewed-on: https://review.typo3.org/52812
Tested-by: TYPO3com <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>

History

#1 Updated by Gerrit Code Review over 3 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/49615

#2 Updated by Gerrit Code Review over 3 years ago

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/49616

#3 Updated by Gerrit Code Review over 3 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/49615

#4 Updated by Gerrit Code Review over 3 years ago

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

#5 Updated by Gerrit Code Review over 3 years ago

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

#6 Updated by Gerrit Code Review over 3 years ago

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

#7 Updated by Gerrit Code Review over 3 years ago

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

#8 Updated by Gerrit Code Review over 2 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/49616

#9 Updated by Gerrit Code Review over 2 years ago

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

#10 Updated by Gerrit Code Review over 2 years ago

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

#11 Updated by Benjamin Serfhos over 2 years ago

  • Related to Bug #64916: Avoid serialization of some members of ContentObjectRenderer added

#12 Updated by Markus Klein over 2 years ago

  • Description updated (diff)

#13 Updated by Gerrit Code Review over 2 years ago

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

#14 Updated by Gerrit Code Review over 2 years ago

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/52811

#15 Updated by Gerrit Code Review over 2 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/52812

#16 Updated by Benjamin Serfhos over 2 years ago

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

#17 Updated by Daniel Goerz over 2 years ago

  • Related to Bug #81866: Regression: css_styled_content does no longer render image captions added

#18 Updated by Daniel Goerz over 2 years ago

This introduced a regression: #81866

#19 Updated by Daniel Goerz over 2 years ago

With the description in this ticket I cannot reproduce this issue (without the patch applied, obviously). Can somebody add the steps one has to perform to reproduce?

I did the following (on 8LTS, since I dont have CSC in 9LTS):

  1. Revert the patch
  2. Installed css_styled_content
  3. Connect to the Signal with a closure
  4. Add text & image on a page
  5. Add a USER_INT on the same page

I do not get any error.

#20 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF