Project

General

Profile

Actions

Bug #105039

open

Method ContentObjectRenderer::mergeTSRef() generates different TypoScript than shown in the backend

Added by Lars Tode about 1 month ago. Updated about 1 month ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
TypoScript
Target version:
-
Start date:
2024-09-19
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

The method \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::mergeTSRef generates TypoScript which is used for Content-Elements.

The TypoScript what is visible within the backend module differs from this generated TypoScript.

The reason is, that the processing of the TypoScript within mergeTSRef() works differently and does not remove settings as expected.

This has an effect in case the fluid viewhelper to render cObjects is used.

To Reproduce

  1. Add an additional DataProcessor to lib.contentElement
    lib.contentElement {
      dataProcessing {
        42 = Acme\Example\DataProcessing\ExampleDataProcessor
      }
    }
    
  2. Create a new content element and reset the dataProcessing
    tt_content.tx_acme_ce =< lib.contentElement
    tt_content.tx_acme_ce {
      templateName = Example
      dataProcessing >
      dataProcessing {
        84 = Acme\Example\DataProcessing\Example2DataProcessor
      }
    }
    
  3. Render the cObject using the ViewHelper
    <f:cObject typoscriptObjectPath="tt_content.tx_acme_ce " data="{item}" />

As a result, the DataProcessor on position 42 was not removed.

Generated TypoScript by mergeTSRef():

tt_content.tx_acme_ce {
  templateName = Example
  dataProcessing {
    42 = Acme\Example\DataProcessing\ExampleDataProcessor
    84 = Acme\Example\DataProcessing\Example2DataProcessor
  }
}

Expected behaviour

The expected result is that the calculated TypoScript is identical to the TypoScript shown in the backend.
TypoScript that is removed should not be available.

tt_content.tx_acme_ce {
  templateName = Example
  dataProcessing {
    84 = Acme\Example\DataProcessing\Example2DataProcessor
  }
}

The DataProcessor on position 42 should not be available nor executed on the content element.

Actions

Also available in: Atom PDF