Skip to content

Commit

Permalink
[TASK] Use Connection instead of PDO
Browse files Browse the repository at this point in the history
In Doctrine DBAL v4, as described in the [documentation](https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/Database/QueryBuilder/Index.html#database-query-builder-create-named-parameter), support for using the `\PDO::PARAM_*` constants has been dropped in favor of the enum types. This should be migrated to `Connection::PARAM_*` in order to be compatible with TYPO3 v13 later on. `Connection::PARAM_*` can already be used now as it is compatible with TYPO3 11 and 12.
  • Loading branch information
ErHaWeb committed Mar 20, 2024
1 parent a920e2a commit 25c5401
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Classes/Command/MigrateFieldsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
->select('uid')
->from('pages')
->where(
$queryBuilder->expr()->eq('tx_realurl_exclude', $queryBuilder->createNamedParameter(1, \PDO::PARAM_INT))
$queryBuilder->expr()->eq('tx_realurl_exclude', $queryBuilder->createNamedParameter(1, Connection::PARAM_INT))
)
->execute()
->fetchAll();
Expand Down
3 changes: 2 additions & 1 deletion Classes/SlugModifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/

use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\DataHandling\SlugHelper;
use TYPO3\CMS\Core\Information\Typo3Version;
Expand Down Expand Up @@ -83,7 +84,7 @@ protected function resolveHookParameters(array $configuration, string $tableName
$stm = $queryBuilder->select('*')
->from('pages')
->where(
$queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($record['uid'], \PDO::PARAM_INT))
$queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($record['uid'], Connection::PARAM_INT))
)
->execute();
if ((GeneralUtility::makeInstance(Typo3Version::class))->getMajorVersion() === 10) {
Expand Down
3 changes: 2 additions & 1 deletion Classes/Updates/MigrateRealUrlExcludeField.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* of the License, or any later version.
*/

use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite;
Expand Down Expand Up @@ -49,7 +50,7 @@ protected function getExistingExcludedPages(): array
->where(
$queryBuilder->expr()->eq(
'tx_realurl_exclude',
$queryBuilder->createNamedParameter(1, \PDO::PARAM_INT)
$queryBuilder->createNamedParameter(1, Connection::PARAM_INT)
)
)
->execute()
Expand Down

0 comments on commit 25c5401

Please sign in to comment.