Issue Bug New Orphaned

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

Lars Tode 09/19/24, 09:56 updated 09/19/24, 10:40

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.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

Fix this issue

Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch

Commit message
[BUGFIX] Method ContentObjectRenderer::mergeTSRef() generates different TypoScript than shown in the backend Resolves: #105039 Releases: main