[BUGFIX] Allow global RTE config again by PageTSConfig 38/57138/4
authorFrank Naegler <frank.naegler@typo3.org>
Thu, 7 Jun 2018 11:23:53 +0000 (13:23 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Thu, 7 Jun 2018 21:01:06 +0000 (23:01 +0200)
With #85016 the PageTSConfig handling has been changed which
broke overloading RTE config by PageTSConfig.
This patch removes the obsolete 'properties' check to fix the problem.

Resolves: #85173
Related: #85016
Releases: master
Change-Id: I85e6d5d9d656ee578451e54f2e226e37cb101fc6
Reviewed-on: https://review.typo3.org/57138
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/core/Classes/Configuration/Richtext.php
typo3/sysext/core/Tests/Unit/Configuration/RichtextTest.php

index 6a48261..4ca3c50 100644 (file)
@@ -169,7 +169,6 @@ class Richtext
     {
         // Load PageTSconfig configuration
         $fullPageTsConfig = $this->getRtePageTsConfigOfPid($pid);
-        $fullPageTsConfig = !empty($fullPageTsConfig['properties']) ? $fullPageTsConfig['properties'] : [];
         $defaultPageTsConfigOverrides = $fullPageTsConfig['default.'] ?? null;
         $fieldSpecificPageTsConfigOverrides = $fullPageTsConfig['config.'][$table . '.'][$field . '.'] ?? null;
         unset($fullPageTsConfig['default.'], $fullPageTsConfig['config.']);
index 39c557c..ef99e3e 100644 (file)
@@ -32,22 +32,20 @@ class RichtextTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
             'enableRichtext' => true,
         ];
         $pageTsConfig = [
-            'properties' => [
-                'classes.' => [
-                    'aClass' => 'aConfig',
-                ],
-                'default.' => [
-                    'removeComments' => '1',
-                ],
-                'config.' => [
-                    'aTable.' => [
-                        'aField.' => [
-                            'types.' => [
-                                'textmedia.' => [
-                                    'proc.' => [
-                                        'overruleMode' => 'myTransformation',
-                                    ],
-                                ]
+            'classes.' => [
+                'aClass' => 'aConfig',
+            ],
+            'default.' => [
+                'removeComments' => '1',
+            ],
+            'config.' => [
+                'aTable.' => [
+                    'aField.' => [
+                        'types.' => [
+                            'textmedia.' => [
+                                'proc.' => [
+                                    'overruleMode' => 'myTransformation',
+                                ],
                             ]
                         ]
                     ]
@@ -87,20 +85,18 @@ class RichtextTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
             'enableRichtext' => true,
         ];
         $pageTsConfig = [
-            'properties' => [
-                'classes.' => [
-                    'aClass' => 'aConfig',
-                ],
-                'default.' => [
-                    'removeComments' => '1',
-                ],
-                'config.' => [
-                    'aTable.' => [
-                        'aField.' => [
-                            'proc.' => [
-                                'overruleMode' => 'myTransformation',
-                            ],
-                        ]
+            'classes.' => [
+                'aClass' => 'aConfig',
+            ],
+            'default.' => [
+                'removeComments' => '1',
+            ],
+            'config.' => [
+                'aTable.' => [
+                    'aField.' => [
+                        'proc.' => [
+                            'overruleMode' => 'myTransformation',
+                        ],
                     ]
                 ]
             ]
@@ -138,14 +134,12 @@ class RichtextTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
             'enableRichtext' => true,
         ];
         $pageTsConfig = [
-            'properties' => [
-                'classes.' => [
-                    'aClass' => 'aConfig',
-                ],
-                'default.' => [
-                    'removeComments' => '1',
-                ],
-            ]
+            'classes.' => [
+                'aClass' => 'aConfig',
+            ],
+            'default.' => [
+                'removeComments' => '1',
+            ],
         ];
         $expected = [
             'classes.' => [
@@ -177,19 +171,17 @@ class RichtextTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
             'enableRichtext' => true,
         ];
         $pageTsConfig = [
-            'properties' => [
+            'classes.' => [
+                'aClass' => 'aConfig',
+            ],
+            'default.' => [
                 'classes.' => [
-                    'aClass' => 'aConfig',
+                    'aClass' => 'anotherConfig',
                 ],
-                'default.' => [
-                    'classes.' => [
-                        'aClass' => 'anotherConfig',
-                    ],
-                    'editor.' => [
-                        'config.' => [
-                            'contentsCss' => 'my.css'
-                        ]
-                    ],
+                'editor.' => [
+                    'config.' => [
+                        'contentsCss' => 'my.css'
+                    ]
                 ],
             ],
         ];
@@ -232,26 +224,24 @@ class RichtextTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
             'enableRichtext' => true,
         ];
         $pageTsConfig = [
-            'properties' => [
+            'classes.' => [
+                'aClass' => 'aConfig',
+            ],
+            'default.' => [
                 'classes.' => [
-                    'aClass' => 'aConfig',
+                    'aClass' => 'anotherConfig',
                 ],
-                'default.' => [
-                    'classes.' => [
-                        'aClass' => 'anotherConfig',
-                    ],
-                ],
-                'config.' => [
-                    'aTable.' => [
-                        'aField.' => [
-                            'classes.' => [
-                                'aClass' => 'aThirdConfig',
-                            ],
-                            'editor.' => [
-                                'config.' => [
-                                    'contentsCss' => 'my.css'
-                                ]
-                            ],
+            ],
+            'config.' => [
+                'aTable.' => [
+                    'aField.' => [
+                        'classes.' => [
+                            'aClass' => 'aThirdConfig',
+                        ],
+                        'editor.' => [
+                            'config.' => [
+                                'contentsCss' => 'my.css'
+                            ]
                         ],
                     ],
                 ],
@@ -298,39 +288,37 @@ class RichtextTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
             'enableRichtext' => true,
         ];
         $pageTsConfig = [
-            'properties' => [
+            'classes.' => [
+                'aClass' => 'aConfig',
+            ],
+            'default.' => [
                 'classes.' => [
-                    'aClass' => 'aConfig',
-                ],
-                'default.' => [
-                    'classes.' => [
-                        'aClass' => 'anotherConfig',
-                    ],
+                    'aClass' => 'anotherConfig',
                 ],
-                'config.' => [
-                    'aTable.' => [
-                        'aField.' => [
-                            'classes.' => [
-                                'aClass' => 'aThirdConfig',
-                            ],
-                            'editor.' => [
-                                'config.' => [
-                                    'contentsCss' => 'my.css'
-                                ]
-                            ],
-                            'types.' => [
-                                'textmedia.' => [
-                                    'classes.' => [
-                                        'aClass' => 'aTypeSpecifcConfig',
-                                    ],
-                                    'editor.' => [
-                                        'config.' => [
-                                            'contentsCss' => 'your.css'
-                                        ]
-                                    ],
-                                ]
+            ],
+            'config.' => [
+                'aTable.' => [
+                    'aField.' => [
+                        'classes.' => [
+                            'aClass' => 'aThirdConfig',
+                        ],
+                        'editor.' => [
+                            'config.' => [
+                                'contentsCss' => 'my.css'
                             ]
                         ],
+                        'types.' => [
+                            'textmedia.' => [
+                                'classes.' => [
+                                    'aClass' => 'aTypeSpecifcConfig',
+                                ],
+                                'editor.' => [
+                                    'config.' => [
+                                        'contentsCss' => 'your.css'
+                                    ]
+                                ],
+                            ]
+                        ]
                     ],
                 ],
             ],
@@ -383,12 +371,10 @@ class RichtextTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
         ];
 
         $pageTsConfigArray = [
-            'properties' => [
-                'preset' => $presetKey,
-                'editor.' => [
-                    'config.' => [
-                        'width' => 200
-                    ],
+            'preset' => $presetKey,
+            'editor.' => [
+                'config.' => [
+                    'width' => 200
                 ],
             ],
         ];