Bug #83809

ckeditor: custom config not loaded in flexform / problem determining pid

Added by Andreas Kiessling almost 4 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2018-02-08
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
ckeditor, flexform
Complexity:
Is Regression:
Sprint Focus:

Description

When a new preset is configured with "RTE.default.preset = myCustomPreset", any "default" RTE should receive the myCustomPreset instead.
The merging / overlaying in \TYPO3\CMS\Core\Configuration\Richtext::getConfiguration relies on the pid to determine the custom config to load.
But somehow, in a flexform context, the pid is 0, thus the default config will be loaded.

I managed to work around this problem in my case by putting the config in the ext_localconf.php and registering it via \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig, but this only works, if you don't need to switch the default e.g. on multitree / multidomain setups.


Files


Related issues

Related to TYPO3 Core - Bug #81748: custom yaml not loaded in flexform field for cke editorClosed2017-06-29

Actions
#1

Updated by Andreas Kiessling almost 4 years ago

  • Tags changed from ckeditor to ckeditor, flexform
#2

Updated by Michael Gaier over 3 years ago

I think, I found a solution.

The `\TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexProcess` creates a new context `$inputToFlexFormSegment` before rendering flex forms, but does not set the `effectivePid` from the parent context.
Therefore the `pid` in `\TYPO3\CMS\Core\Configuration\Richtext::getConfiguration` is 0 and no custom config is loaded, because you can not have `pageTsConfig` on pid 0.

#3

Updated by Vendy Tjung over 3 years ago

Michael Gaier wrote:

I think, I found a solution.

The `\TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexProcess` creates a new context `$inputToFlexFormSegment` before rendering flex forms, but does not set the `effectivePid` from the parent context.
Therefore the `pid` in `\TYPO3\CMS\Core\Configuration\Richtext::getConfiguration` is 0 and no custom config is loaded, because you can not have `pageTsConfig` on pid 0.

I can confirm the changes work on TYPO3 version 8.7.

#4

Updated by Vendy Tjung over 3 years ago

  • Related to Bug #81748: custom yaml not loaded in flexform field for cke editor added
#5

Updated by Patrick no-lastname-given about 3 years ago

I can also confirm that the patch work with TYPO3 8.7.19.

#6

Updated by Gerrit Code Review about 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/58797

#7

Updated by Gerrit Code Review about 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/58797

#8

Updated by Gerrit Code Review about 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/58797

#9

Updated by Gerrit Code Review about 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/58797

#10

Updated by Anonymous about 3 years ago

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

Updated by Gerrit Code Review about 3 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/58823

#12

Updated by Anonymous about 3 years ago

  • Status changed from Under Review to Resolved
#13

Updated by Benni Mack over 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF