Skip to content

Commit 348828e

Browse files
committed
[TASK] Add gridelements nested support
With `gridelements` installed the extension internal override of the DatabaseRecordList won't work anymore, as `gridelements` overrides the same way. This commit adjusts the implementation by overriding the respective class depending on the installed `gridelements` extension and respecting the setting if the nested content element support is enabled. As `gridelements` has no public available repository for TYPO3 13, assume this workflow works in 13.
1 parent 8db1794 commit 348828e

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
3+
class_alias(\TYPO3\CMS\Backend\RecordList\DatabaseRecordList::class, 'WebVision\\Deepltranslate\\Core\\Override\\Core12\\BaseDatabaseRecordList');

Build/phpstan/Core12/phpstan.neon

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ parameters:
1717
- ../../../Tests/Functional/Updates/Fixtures/Extension/test_extension/ext_emconf.php
1818
- ../../../Tests/Functional/Fixtures/Extensions/test_services_override/ext_emconf.php
1919
- ../../../Tests/Functional/Fixtures/Extensions/testing_framework_backenduserhandler_replacement/ext_emconf.php
20+
bootstrapFiles:
21+
- classAliasses.php
2022

2123
typo3:
2224
contextApiGetAspectMapping:

Classes/Override/Core12/DatabaseRecordList.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,25 @@
88
use WebVision\Deepltranslate\Core\Event\DisallowTableFromDeeplTranslateEvent;
99
use WebVision\Deepltranslate\Core\Utility\DeeplBackendUtility;
1010

11+
/**
12+
* This is an ugly hack to allow
13+
* both gridelements and TYPO3 backend as override for DatabaseRecordList.
14+
*
15+
* This is needed to avoid issues when having both extensions installed.
16+
*/
17+
if (class_exists(\GridElementsTeam\Gridelements\Xclass\DatabaseRecordList::class) && !empty($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['gridelements']['nestingInListModule'])) {
18+
class_alias(\GridElementsTeam\Gridelements\Xclass\DatabaseRecordList::class, 'WebVision\\Deepltranslate\\Core\\Override\\Core12\\BaseDatabaseRecordList');
19+
} else {
20+
class_alias(\TYPO3\CMS\Backend\RecordList\DatabaseRecordList::class, 'WebVision\\Deepltranslate\\Core\\Override\\Core12\\BaseDatabaseRecordList');
21+
}
22+
1123
/**
1224
* Class for rendering of Web>List module
1325
*
1426
* @internal
1527
* @override
1628
*/
17-
class DatabaseRecordList extends \TYPO3\CMS\Backend\RecordList\DatabaseRecordList
29+
class DatabaseRecordList extends BaseDatabaseRecordList
1830
{
1931
/**
2032
* Creates the localization panel

0 commit comments

Comments
 (0)