Skip to content
Snippets Groups Projects
Commit ff427916 authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASK] Replace deprecated function with doctrine query to retrieve pageroots for the backend module

parent 580d51ff
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,7 @@ use SGalinski\SgMail\Domain\Repository\MailRepository;
use SGalinski\SgMail\Domain\Repository\TemplateRepository;
use Swift_Attachment;
use Swift_OutputByteStream;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Mail\MailMessage;
use TYPO3\CMS\Core\Resource\FileInterface;
use TYPO3\CMS\Core\Resource\ResourceFactory;
......@@ -515,10 +516,23 @@ class MailTemplateService {
}
if ($pageUid === 0) {
$pageRepository = $this->objectManager->get(PageRepository::class);
$rootPageRows = $pageRepository->getRecordsByField(
'pages', 'is_siteroot', 1, 'hidden = 0', '', 'sorting', 1
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable(
'pages'
);
$rootPageRows = $queryBuilder->select('*')
->from('tx_sgshop_domain_model_voucher')
->where(
$queryBuilder->expr()->eq(
'is_siteroot', 1
)
)
->andWhere(
$queryBuilder->expr()->eq(
'hidden', 0
)
)
->execute()->fetchAll();
if ($rootPageRows && \count($rootPageRows)) {
$pageUid = (int) $rootPageRows[0]['uid'];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment