Skip to content

Commit 78fc297

Browse files
cweiskeNamelessCoder
authored andcommitted
[BUGFIX] Use ExpressionBuilder::and when available, andX as fallback
TYPO3v12 brings a deprecation warning when copying a container with nested content elements: > TYPO3 Deprecation Notice: > ExpressionBuilder::andX() will be removed in TYPO3 v13.0. > Use ExpressionBuilder::and() instead. in > vendor/typo3/cms-core/Classes/Database/Query/Expression/ExpressionBuilder.php > line 72 The `and` method was introduced in TYPO3v11, and in v12 it was deprecated. This patch switches the order: When `and` is available, it is used, and the code falls back to `andX` for TYPO3v10. Changelog: https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.0/Deprecation-97354-ExpressionBuilderMethodsAndXAndOrX.html Resolves: #2233
1 parent 3b102cd commit 78fc297

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Classes/Integration/HookSubscribers/DataHandlerSubscriber.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public function processDatamap_afterDatabaseOperations($command, $table, $id, $f
149149
if ($newColumnPosition > 0) {
150150
$queryBuilder = $this->createQueryBuilderForTable($table);
151151
$expr = $queryBuilder->expr();
152-
$andMethodName = method_exists($expr, 'andX') ? 'andX' : 'and';
152+
$andMethodName = method_exists($expr, 'and') ? 'and' : 'andX';
153153
$queryBuilder->update($table)->set('colPos', $newColumnPosition, true, Connection::PARAM_INT)->where(
154154
$expr->eq(
155155
'uid',

0 commit comments

Comments
 (0)