diff --git a/Classes/Controller/BackendController.php b/Classes/Controller/BackendController.php index 47d90230..7f000494 100644 --- a/Classes/Controller/BackendController.php +++ b/Classes/Controller/BackendController.php @@ -138,11 +138,11 @@ protected function initializeDataTables(): void * * @throws \BadFunctionCallException */ - public function setupWizardAction(): string + public function setupWizardAction(): ResponseInterface { - return $this->render('Backend/SetupWizard.html', [ + return $this->htmlResponse($this->render('Backend/SetupWizard.html', [ 'blogSetups' => $this->setupService->determineBlogSetups(), - ]); + ])); } /** diff --git a/Classes/Controller/PostController.php b/Classes/Controller/PostController.php index d7ec1c55..65f75088 100644 --- a/Classes/Controller/PostController.php +++ b/Classes/Controller/PostController.php @@ -22,15 +22,12 @@ use T3G\AgencyPack\Blog\Service\CacheService; use T3G\AgencyPack\Blog\Service\MetaTagService; use T3G\AgencyPack\Blog\Utility\ArchiveUtility; -use TYPO3\CMS\Core\Context\Context; -use TYPO3\CMS\Core\Exception; use TYPO3\CMS\Core\Http\NormalizedParams; use TYPO3\CMS\Core\Pagination\SimplePagination; use TYPO3\CMS\Core\Site\Entity\SiteLanguage; use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; use TYPO3\CMS\Extbase\Mvc\View\ViewInterface; use TYPO3\CMS\Extbase\Pagination\QueryResultPaginator; -use TYPO3\CMS\Extbase\Utility\DebuggerUtility; use TYPO3\CMS\Extbase\Utility\LocalizationUtility; use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; diff --git a/Classes/Domain/Repository/PostRepository.php b/Classes/Domain/Repository/PostRepository.php index 3c2cc3cb..41146f12 100644 --- a/Classes/Domain/Repository/PostRepository.php +++ b/Classes/Domain/Repository/PostRepository.php @@ -17,6 +17,7 @@ use T3G\AgencyPack\Blog\Domain\Model\Post; use T3G\AgencyPack\Blog\Domain\Model\Tag; use TYPO3\CMS\Core\Context\Context; +use TYPO3\CMS\Core\Http\ApplicationType; use TYPO3\CMS\Core\Site\Entity\Site; use TYPO3\CMS\Core\Site\Entity\SiteLanguage; use TYPO3\CMS\Core\Utility\GeneralUtility; @@ -427,7 +428,7 @@ protected function getStoragePidsFromTypoScript(): array */ protected function getStoragePidConstraint(): ?ComparisonInterface { - if (TYPO3_MODE === 'FE') { + if (ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST'])->isFrontend()) { $pids = $this->getPidsForConstraints(); $query = $this->createQuery(); return $query->in('pid', $pids); diff --git a/Classes/Mail/MailMessage.php b/Classes/Mail/MailMessage.php index e70bdd0d..bdc36e95 100644 --- a/Classes/Mail/MailMessage.php +++ b/Classes/Mail/MailMessage.php @@ -10,6 +10,7 @@ namespace T3G\AgencyPack\Blog\Mail; +use Symfony\Component\Mime\Email; use TYPO3\CMS\Core\Mail\MailMessage as CoreMailMessage; use TYPO3\CMS\Core\Utility\GeneralUtility; @@ -95,7 +96,7 @@ public function send(): bool $this->mailMessage->setFrom($this->getFrom()); $this->mailMessage->setTo($this->getTo()); - if ($this->mailMessage instanceof \Symfony\Component\Mime\Email) { + if ($this->mailMessage instanceof Email) { $this->mailMessage->html($this->getBody()); } else { $this->mailMessage->setBody($this->getBody(), 'text/html'); diff --git a/Classes/Service/CacheService.php b/Classes/Service/CacheService.php index 26172fa1..06afe1c9 100644 --- a/Classes/Service/CacheService.php +++ b/Classes/Service/CacheService.php @@ -76,7 +76,7 @@ public function flushCacheByTag(string $tag): void public function flushCacheByTags(array $tags): void { GeneralUtility::makeInstance(CacheManager::class) - ->getCache('cache_pages') + ->getCache('pages') ->flushByTags($tags); } diff --git a/Configuration/DataHandler/BlogSetupRecords.php b/Configuration/DataHandler/BlogSetupRecords.php index a1cca7ac..8ae676d6 100644 --- a/Configuration/DataHandler/BlogSetupRecords.php +++ b/Configuration/DataHandler/BlogSetupRecords.php @@ -7,6 +7,9 @@ * LICENSE file that was distributed with this source code. */ +use T3G\AgencyPack\Blog\Constants; +use TYPO3\CMS\Core\Domain\Repository\PageRepository; + $data = []; // Pages @@ -14,7 +17,7 @@ 'pid' => 0, 'hidden' => 1, 'title' => 'Blog', - 'doktype' => \T3G\AgencyPack\Blog\Constants::DOKTYPE_BLOG_PAGE, + 'doktype' => Constants::DOKTYPE_BLOG_PAGE, 'is_siteroot' => 1, 'TSconfig' => 'TCEFORM.pages.tags.PAGE_TSCONFIG_ID = NEW_blogFolder TCEFORM.pages.authors.PAGE_TSCONFIG_ID = NEW_blogFolder @@ -24,38 +27,38 @@ 'pid' => 'NEW_blogRoot', 'hidden' => 0, 'title' => 'Data', - 'doktype' => \TYPO3\CMS\Core\Domain\Repository\PageRepository::DOKTYPE_SYSFOLDER, + 'doktype' => PageRepository::DOKTYPE_SYSFOLDER, 'module' => 'blog' ]; $data['pages']['NEW_blogCategoryPage'] = [ 'pid' => '-NEW_blogFolder', 'hidden' => 0, 'title' => 'Category', - 'doktype' => \T3G\AgencyPack\Blog\Constants::DOKTYPE_BLOG_PAGE, + 'doktype' => Constants::DOKTYPE_BLOG_PAGE, ]; $data['pages']['NEW_blogTagPage'] = [ 'pid' => '-NEW_blogCategoryPage', 'hidden' => 0, 'title' => 'Tag', - 'doktype' => \T3G\AgencyPack\Blog\Constants::DOKTYPE_BLOG_PAGE, + 'doktype' => Constants::DOKTYPE_BLOG_PAGE, ]; $data['pages']['NEW_blogAuthorPage'] = [ 'pid' => '-NEW_blogTagPage', 'hidden' => 0, 'title' => 'Author', - 'doktype' => \T3G\AgencyPack\Blog\Constants::DOKTYPE_BLOG_PAGE, + 'doktype' => Constants::DOKTYPE_BLOG_PAGE, ]; $data['pages']['NEW_blogArchivePage'] = [ 'pid' => '-NEW_blogAuthorPage', 'hidden' => 0, 'title' => 'Archive', - 'doktype' => \T3G\AgencyPack\Blog\Constants::DOKTYPE_BLOG_PAGE, + 'doktype' => Constants::DOKTYPE_BLOG_PAGE, ]; $data['pages']['NEW_firstBlogPostPage'] = [ 'pid' => 'NEW_blogFolder', 'hidden' => 0, 'title' => 'First blog post', - 'doktype' => \T3G\AgencyPack\Blog\Constants::DOKTYPE_BLOG_POST, + 'doktype' => Constants::DOKTYPE_BLOG_POST, 'abstract' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ut consectetur quam. Ut rutrum augue libero, non rhoncus libero imperdiet vel. Pellentesque libero orci, porttitor sed dui vel, tempus sodales ex. Sed placerat lobortis tellus at tempus.' ]; @@ -135,12 +138,12 @@ // Categories $data['sys_category']['NEW_blogCategoryRoot'] = [ 'pid' => 'NEW_blogFolder', - 'record_type' => \T3G\AgencyPack\Blog\Constants::CATEGORY_TYPE_BLOG, + 'record_type' => Constants::CATEGORY_TYPE_BLOG, 'title' => 'Blog', ]; $data['sys_category']['NEW_blogCategoryTYPO3'] = [ 'pid' => 'NEW_blogFolder', - 'record_type' => \T3G\AgencyPack\Blog\Constants::CATEGORY_TYPE_BLOG, + 'record_type' => Constants::CATEGORY_TYPE_BLOG, 'parent' => 'NEW_blogCategoryRoot', 'title' => 'TYPO3', ]; diff --git a/Configuration/TCA/Overrides/pages.php b/Configuration/TCA/Overrides/pages.php index f831b9c6..6902f145 100644 --- a/Configuration/TCA/Overrides/pages.php +++ b/Configuration/TCA/Overrides/pages.php @@ -7,7 +7,7 @@ * LICENSE file that was distributed with this source code. */ -if (!defined('TYPO3_MODE')) { +if (!defined('TYPO3')) { die('Access denied.'); } diff --git a/Configuration/TCA/Overrides/sys_category.php b/Configuration/TCA/Overrides/sys_category.php index 95b807fe..eeaadfe4 100644 --- a/Configuration/TCA/Overrides/sys_category.php +++ b/Configuration/TCA/Overrides/sys_category.php @@ -7,7 +7,7 @@ * LICENSE file that was distributed with this source code. */ -if (!defined('TYPO3_MODE')) { +if (!defined('TYPO3')) { die('Access denied.'); } diff --git a/Configuration/TCA/Overrides/sys_template.php b/Configuration/TCA/Overrides/sys_template.php index d23a255d..00662668 100644 --- a/Configuration/TCA/Overrides/sys_template.php +++ b/Configuration/TCA/Overrides/sys_template.php @@ -7,7 +7,7 @@ * LICENSE file that was distributed with this source code. */ -if (!defined('TYPO3_MODE')) { +if (!defined('TYPO3')) { die('Access denied.'); } diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php index ca4a00b0..2e54c510 100644 --- a/Configuration/TCA/Overrides/tt_content.php +++ b/Configuration/TCA/Overrides/tt_content.php @@ -7,7 +7,7 @@ * LICENSE file that was distributed with this source code. */ -if (!defined('TYPO3_MODE')) { +if (!defined('TYPO3')) { die('Access denied.'); } diff --git a/Configuration/TCA/tx_blog_domain_model_author.php b/Configuration/TCA/tx_blog_domain_model_author.php index a83fb64f..eadae356 100644 --- a/Configuration/TCA/tx_blog_domain_model_author.php +++ b/Configuration/TCA/tx_blog_domain_model_author.php @@ -7,7 +7,7 @@ * LICENSE file that was distributed with this source code. */ -if (!defined('TYPO3_MODE')) { +if (!defined('TYPO3')) { die('Access denied.'); } @@ -21,7 +21,6 @@ 'tstamp' => 'tstamp', 'crdate' => 'crdate', 'cruser_id' => 'cruser_id', - 'dividers2tabs' => true, 'default_sortby' => 'ORDER BY title', 'delete' => 'deleted', 'enablecolumns' => [ diff --git a/Configuration/TCA/tx_blog_domain_model_comment.php b/Configuration/TCA/tx_blog_domain_model_comment.php index 097e07e6..9c855a10 100644 --- a/Configuration/TCA/tx_blog_domain_model_comment.php +++ b/Configuration/TCA/tx_blog_domain_model_comment.php @@ -7,7 +7,7 @@ * LICENSE file that was distributed with this source code. */ -if (!defined('TYPO3_MODE')) { +if (!defined('TYPO3')) { die('Access denied.'); } @@ -22,7 +22,6 @@ 'tstamp' => 'tstamp', 'crdate' => 'crdate', 'cruser_id' => 'cruser_id', - 'dividers2tabs' => true, 'default_sortby' => 'ORDER BY crdate DESC', 'delete' => 'deleted', 'enablecolumns' => [ diff --git a/Configuration/TCA/tx_blog_domain_model_tag.php b/Configuration/TCA/tx_blog_domain_model_tag.php index 9f20b72c..7ef4a364 100644 --- a/Configuration/TCA/tx_blog_domain_model_tag.php +++ b/Configuration/TCA/tx_blog_domain_model_tag.php @@ -7,7 +7,7 @@ * LICENSE file that was distributed with this source code. */ -if (!defined('TYPO3_MODE')) { +if (!defined('TYPO3')) { die('Access denied.'); } @@ -26,7 +26,6 @@ 'tstamp' => 'tstamp', 'crdate' => 'crdate', 'cruser_id' => 'cruser_id', - 'dividers2tabs' => true, 'default_sortby' => 'ORDER BY title', 'delete' => 'deleted', 'enablecolumns' => [ diff --git a/ext_emconf.php b/ext_emconf.php index 62ad005c..64060528 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -12,9 +12,6 @@ 'description' => 'This blog extension uses TYPO3s core concepts and elements to provide a full-blown blog that users of TYPO3 can instantly understand and use.', 'category' => 'fe', 'state' => 'stable', - 'uploadfolder' => 0, - 'createDirs' => '', - 'clearCacheOnLoad' => 0, 'author' => 'TYPO3 GmbH', 'author_email' => 'info@typo3.com', 'version' => '11.0.0-dev', diff --git a/ext_localconf.php b/ext_localconf.php index ef6be57e..562e90c3 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -7,7 +7,7 @@ * LICENSE file that was distributed with this source code. */ -if (!defined('TYPO3_MODE')) { +if (!defined('TYPO3')) { die('Access denied.'); } diff --git a/ext_tables.php b/ext_tables.php index cfe872c4..057a4be9 100644 --- a/ext_tables.php +++ b/ext_tables.php @@ -7,7 +7,7 @@ * LICENSE file that was distributed with this source code. */ -if (!defined('TYPO3_MODE')) { +if (!defined('TYPO3')) { die('Access denied.'); }