Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support TYPO3 v13 #316

Merged
merged 49 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
8a46930
[TASK] Provide EXT:form in functional tests
bnf Oct 15, 2024
f6c03ac
[TASK] Prepare README.rst for v13
bmack Sep 9, 2024
466fc12
[TASK] Update github workflows for v13
bnf Oct 15, 2024
02440f4
[TASK] Start v13 migration
achimfritz-b13 May 24, 2024
964e3d5
[TASK] Use typo3/testing-framework v9
bnf Oct 15, 2024
e4f0f0f
[TASK] Update v13 composer dependencies
bnf Oct 15, 2024
cf043e3
[TASK] Mark v13 as supported in ext_emconf
bnf Oct 16, 2024
9dedafd
[TASK] Remove outdated post-autoload-dump script
bnf Oct 16, 2024
72506e5
[TASK] Replace deprecated php-cs-fixer setting function_typehint_space
bnf Oct 16, 2024
8f3c9ba
[TASK] Use Configuration/user.tsconfig in v13
bnf Oct 16, 2024
fc1590d
[TASK] Drop v11 drawHeaderHook registration
bnf Oct 16, 2024
160190d
[TASK] Adapt CommentFormFactory for v13
bnf Oct 15, 2024
ee231e0
[TASK] Replace TSFE->tmp->setup by frontend.typoscript attribute
bnf Oct 16, 2024
2f272d2
[TASK] Register upgrade wizards via attribute
bnf Oct 16, 2024
845aae1
[TASK] Replace EMU::addPageTSConfig by Configuration/page.tsconfig
bnf Oct 16, 2024
6ff3fa7
[TASK] Make AbstractUpdate v13 compatible
bnf Oct 16, 2024
0c1760f
[TASK] Replace Bootstrap::initializeLanguageObject() in tests for v13
bnf Oct 16, 2024
0d0f0cf
[TASK] Adapt GravatarProviderTest for v13
bnf Oct 16, 2024
73e50f5
[TASK] Adapt GravatarViewHelperTest for v13
bnf Oct 16, 2024
0191ec4
[TASK] Adapt SiteBasedTestCase for v13
bnf Oct 16, 2024
3365532
[TASK] Adapt AvatarViewHelperTest for v13
bnf Oct 16, 2024
4a8c0a2
[TASK] Use phpunit attributes in tests
bnf Oct 16, 2024
52881e0
[TASK] Correct DataHandlerHookTest namespace to match psr-4
bnf Oct 16, 2024
60eede4
[TASK] Replace getTwoLetterIsoCode
bnf Oct 16, 2024
0f98fac
[TASK] Register icons via Configuration/Icons.php
bnf Oct 16, 2024
85c4716
[TASK] Migrate to ES6 JavaScript modules
bnf Oct 16, 2024
d3d8999
[TASK] Update to current backend module API
bnf Oct 16, 2024
e37385d
[TASK] Make creation wizard context aware
bnf Oct 16, 2024
b5b5d54
[TASK] Add a workaround for too strict typing in TagBuilder
bnf Oct 16, 2024
f6c0945
[TASK] Replace ConfigurationManager->getContentObject for v13
bnf Oct 16, 2024
a5db722
[TASK] Adapt WidgetController for v13
bnf Oct 16, 2024
3abcbe0
[TASK] Make backend styles light/dark aware for v13
bnf Oct 16, 2024
7c4a960
[TASK] Adapt GoogleCaptchaValidator for v13
bnf Oct 16, 2024
51d2548
[TASK] Drop actions-decline icons
bnf Oct 17, 2024
4f1fc32
[BUGFIX] Fix count view helper usage in setup wizard
bnf Oct 17, 2024
f6f39a1
[TASK] Remove unneeded fluid register(Universal)TagAttribute(s) calls
bnf Oct 17, 2024
c19ad73
[TASK] Avoid renderStatic which has been deprecated
bnf Oct 17, 2024
f402b21
[TASK] Use ContextualFeedbackSeverity for v13
bnf Oct 17, 2024
5c559af
[TASK] Replace deprecated Connection::PARAM_STR_ARRAY
bnf Oct 17, 2024
4ca2c2e
[TASK] Do not try to read id from POST body in blogpost header renderer
bnf Oct 17, 2024
3dfca4f
[TASK] Replace deprecated fillDefaultsByPackageName
bnf Oct 17, 2024
fa00afa
[TASK] Check return type of findByUid in PostRepository
bnf Oct 17, 2024
f9869d0
[TASK] Resolve v12 phpstan errors
bnf Oct 17, 2024
321664c
[TASK] Migrate deprecated phpstan options
bnf Oct 17, 2024
3f4035d
[TASK] Resolve v12 TCA deprecations
bnf Oct 17, 2024
1dd7c6e
[TASK] Replace INCLUDE_TYPOSCRIPT by @import
bnf Oct 17, 2024
3aaa686
[TASK] Update version shields in README
bnf Oct 17, 2024
32754a3
[TASK] Ensure typo3fluid/fluid 2.15 is available in classic mode
bnf Oct 17, 2024
0b7084a
[TASK] Update deprecated github actions
bnf Oct 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,18 @@ jobs:
strategy:
fail-fast: false
matrix:
typo3: ['^11', '^12']
php: ['7.4', '8.0', '8.1', '8.2']
mysql: ['5.7', '8.0']
typo3: ['^12', '^13']
php: ['8.1', '8.2', '8.3']
mysql: ['5.7', '8.0', '8.4']
exclude:
- typo3: '^11'
mysql: '8.0'
- typo3: '^12'
- typo3: '^13'
mysql: '5.7'
- typo3: '^12'
php: '7.4'
- typo3: '^12'
php: '8.0'
- typo3: '^13'
php: '8.1'
steps:
- id: checkout
name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4

- id: setup_mysql
name: Set up MySQL ${{ matrix.mysql }}
Expand All @@ -54,7 +50,7 @@ jobs:

- id: composer-cache-dependencies
name: Cache Composer dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache-vars.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.typo3 }}-${{ steps.composer-cache-vars.outputs.timestamp }}
Expand Down
2 changes: 1 addition & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
'no_blank_lines_after_phpdoc' => true,
'array_syntax' => ['syntax' => 'short'],
'whitespace_after_comma_in_array' => true,
'function_typehint_space' => true,
'type_declaration_spaces' => true,
'single_line_comment_style' => true,
'no_alias_functions' => true,
'lowercase_cast' => true,
Expand Down
34 changes: 2 additions & 32 deletions Build/phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,36 +1,6 @@
parameters:
ignoreErrors:
-
message: "#^Call to method addHeaderContent\\(\\) on an unknown class TYPO3\\\\CMS\\\\Backend\\\\Controller\\\\Event\\\\ModifyPageLayoutContentEvent\\.$#"
message: "#^Return type \\(TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\QueryResultInterface\\) of method T3G\\\\AgencyPack\\\\Blog\\\\Domain\\\\Repository\\\\PostRepository\\:\\:findAll\\(\\) should be covariant with return type \\(iterable\\<object\\>\\) of method TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\RepositoryInterface\\<object\\>\\:\\:findAll\\(\\)$#"
count: 1
path: ../Classes/Listener/ModifyPageLayoutContent.php

-
message: "#^Call to method getRequest\\(\\) on an unknown class TYPO3\\\\CMS\\\\Backend\\\\Controller\\\\Event\\\\ModifyPageLayoutContentEvent\\.$#"
count: 1
path: ../Classes/Listener/ModifyPageLayoutContent.php

-
message: "#^Method T3G\\\\AgencyPack\\\\Blog\\\\Listener\\\\ModifyPageLayoutContent\\:\\:__invoke\\(\\) has no return type specified\\.$#"
count: 1
path: ../Classes/Listener/ModifyPageLayoutContent.php

-
message: "#^Parameter \\$event of method T3G\\\\AgencyPack\\\\Blog\\\\Listener\\\\ModifyPageLayoutContent\\:\\:__invoke\\(\\) has invalid type TYPO3\\\\CMS\\\\Backend\\\\Controller\\\\Event\\\\ModifyPageLayoutContentEvent\\.$#"
count: 1
path: ../Classes/Listener/ModifyPageLayoutContent.php

-
message: "#^Call to method addContentAbove\\(\\) on an unknown class TYPO3\\\\CMS\\\\Backend\\\\Controller\\\\Event\\\\RenderAdditionalContentToRecordListEvent\\.$#"
count: 1
path: ../Classes/Listener/RenderAdditionalContentToRecordList.php

-
message: "#^Call to method getRequest\\(\\) on an unknown class TYPO3\\\\CMS\\\\Backend\\\\Controller\\\\Event\\\\RenderAdditionalContentToRecordListEvent\\.$#"
count: 1
path: ../Classes/Listener/RenderAdditionalContentToRecordList.php

-
message: "#^Parameter \\$event of method T3G\\\\AgencyPack\\\\Blog\\\\Listener\\\\RenderAdditionalContentToRecordList\\:\\:__invoke\\(\\) has invalid type TYPO3\\\\CMS\\\\Backend\\\\Controller\\\\Event\\\\RenderAdditionalContentToRecordListEvent\\.$#"
count: 1
path: ../Classes/Listener/RenderAdditionalContentToRecordList.php
path: ../Classes/Domain/Repository/PostRepository.php
6 changes: 4 additions & 2 deletions Build/phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ includes:

parameters:
level: 8
checkMissingIterableValueType: false
reportUnmatchedIgnoredErrors: false
checkGenericClassInNonGenericObjectType: false

ignoreErrors:
-
identifier: missingType.iterableValue
-
identifier: missingType.generics
- "#Casting to string something that's already string.#"
- "#Casting to int something that's already int.#"
- "#Casting to bool something that's already bool.#"
Expand Down
5 changes: 3 additions & 2 deletions Classes/Backend/View/BlogPostHeaderContentRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
return '';
}

$pageUid = (int)($request->getParsedBody()['id'] ?? $request->getQueryParams()['id'] ?? 0);
$pageUid = (int)($request->getQueryParams()['id'] ?? 0);
$pageInfo = BackendUtility::readPageAccess($pageUid, $GLOBALS['BE_USER']->getPagePermsClause(Permission::PAGE_SHOW));
if (($pageInfo['doktype'] ?? 0) !== Constants::DOKTYPE_BLOG_POST) {
return '';
Expand All @@ -57,8 +57,9 @@
$this->postRepository->setDefaultQuerySettings($querySettings);
$post = $this->postRepository->findByUidRespectQuerySettings($pageUid);

$view = GeneralUtility::makeInstance(StandaloneView::class);

Check failure on line 60 in Classes/Backend/View/BlogPostHeaderContentRenderer.php

View workflow job for this annotation

GitHub Actions / Build PHP (^13, 8.2, 8.4)

Fetching class constant class of deprecated class TYPO3\CMS\Fluid\View\StandaloneView: : since TYPO3 v13, will be removed in v14. Use ext:core ViewFactoryInterface instead.

Check failure on line 60 in Classes/Backend/View/BlogPostHeaderContentRenderer.php

View workflow job for this annotation

GitHub Actions / Build PHP (^13, 8.3, 8.0)

Fetching class constant class of deprecated class TYPO3\CMS\Fluid\View\StandaloneView: : since TYPO3 v13, will be removed in v14. Use ext:core ViewFactoryInterface instead.

Check failure on line 60 in Classes/Backend/View/BlogPostHeaderContentRenderer.php

View workflow job for this annotation

GitHub Actions / Build PHP (^13, 8.2, 8.0)

Fetching class constant class of deprecated class TYPO3\CMS\Fluid\View\StandaloneView: : since TYPO3 v13, will be removed in v14. Use ext:core ViewFactoryInterface instead.

Check failure on line 60 in Classes/Backend/View/BlogPostHeaderContentRenderer.php

View workflow job for this annotation

GitHub Actions / Build PHP (^13, 8.3, 8.4)

Fetching class constant class of deprecated class TYPO3\CMS\Fluid\View\StandaloneView: : since TYPO3 v13, will be removed in v14. Use ext:core ViewFactoryInterface instead.

Check failure on line 60 in Classes/Backend/View/BlogPostHeaderContentRenderer.php

View workflow job for this annotation

GitHub Actions / Build PHP (^13, 8.2, 8.4)

Fetching class constant class of deprecated class TYPO3\CMS\Fluid\View\StandaloneView: : since TYPO3 v13, will be removed in v14. Use ext:core ViewFactoryInterface instead.

Check failure on line 60 in Classes/Backend/View/BlogPostHeaderContentRenderer.php

View workflow job for this annotation

GitHub Actions / Build PHP (^13, 8.3, 8.4)

Fetching class constant class of deprecated class TYPO3\CMS\Fluid\View\StandaloneView: : since TYPO3 v13, will be removed in v14. Use ext:core ViewFactoryInterface instead.

Check failure on line 60 in Classes/Backend/View/BlogPostHeaderContentRenderer.php

View workflow job for this annotation

GitHub Actions / Build PHP (^13, 8.3, 8.0)

Fetching class constant class of deprecated class TYPO3\CMS\Fluid\View\StandaloneView: : since TYPO3 v13, will be removed in v14. Use ext:core ViewFactoryInterface instead.

Check failure on line 60 in Classes/Backend/View/BlogPostHeaderContentRenderer.php

View workflow job for this annotation

GitHub Actions / Build PHP (^13, 8.2, 8.0)

Fetching class constant class of deprecated class TYPO3\CMS\Fluid\View\StandaloneView: : since TYPO3 v13, will be removed in v14. Use ext:core ViewFactoryInterface instead.
$view->getRenderingContext()->getTemplatePaths()->fillDefaultsByPackageName('blog');
//$view->getRenderingContext()->getTemplatePaths()->fillDefaultsByPackageName('blog');
$view->getRenderingContext()->getTemplatePaths()->setTemplateRootPaths(['EXT:blog/Resources/Private/Templates']);
$view->setTemplate('PageLayout/Header');
$view->assignMultiple([
'pageUid' => $pageUid,
Expand Down
34 changes: 15 additions & 19 deletions Classes/Controller/BackendController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
use T3G\AgencyPack\Blog\Service\SetupService;
use TYPO3\CMS\Backend\Template\ModuleTemplateFactory;
use TYPO3\CMS\Core\Http\RedirectResponse;
use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;

class BackendController extends ActionController
Expand Down Expand Up @@ -49,14 +49,13 @@ public function __construct(

public function initializeAction(): void
{
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Tooltip');
$this->pageRenderer->addCssFile('EXT:blog/Resources/Public/Css/backend.min.css', 'stylesheet', 'all', '', false);
}

public function initializeSetupWizardAction(): void
{
$this->initializeDataTables();
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Blog/SetupWizard');
$this->pageRenderer->loadJavaScriptModule('@t3g/blog/setup-wizard.js');
}

public function initializePostsAction(): void
Expand All @@ -67,24 +66,23 @@ public function initializePostsAction(): void
public function initializeCommentsAction(): void
{
$this->initializeDataTables();
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Blog/MassUpdate');
$this->pageRenderer->loadJavaScriptModule('@t3g/blog/mass-update.js');
}

protected function initializeDataTables(): void
{
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Blog/Datatables');
$this->pageRenderer->addCssFile('EXT:blog/Resources/Public/Css/Datatables.min.css', 'stylesheet', 'all', '', false);
$this->pageRenderer->loadJavaScriptModule('@t3g/blog/datatables.js');
$this->pageRenderer->addCssFile('EXT:blog/Resources/Public/Css/datatables.min.css', 'stylesheet', 'all', '', false);
}

public function setupWizardAction(): ResponseInterface
{
$this->view->assignMultiple([
$view = $this->moduleTemplateFactory->create($this->request);
$view->assignMultiple([
'blogSetups' => $this->setupService->determineBlogSetups(),
]);
$moduleTemplate = $this->moduleTemplateFactory->create($this->request);
$moduleTemplate->setContent($this->view->render());

return $this->htmlResponse($moduleTemplate->renderContent());
return $view->renderResponse('Backend/SetupWizard');
}

public function postsAction(int $blogSetup = null): ResponseInterface
Expand All @@ -94,20 +92,20 @@ public function postsAction(int $blogSetup = null): ResponseInterface
$querySettings->setIgnoreEnableFields(true);
$this->postRepository->setDefaultQuerySettings($querySettings);

$this->view->assignMultiple([
$view = $this->moduleTemplateFactory->create($this->request);
$view->assignMultiple([
'blogSetups' => $this->setupService->determineBlogSetups(),
'activeBlogSetup' => $blogSetup,
'posts' => $this->postRepository->findAllByPid($blogSetup),
]);
$moduleTemplate = $this->moduleTemplateFactory->create($this->request);
$moduleTemplate->setContent($this->view->render());

return $this->htmlResponse($moduleTemplate->renderContent());
return $view->renderResponse('Backend/Posts');
}

public function commentsAction(string $filter = null, int $blogSetup = null): ResponseInterface
{
$this->view->assignMultiple([
$view = $this->moduleTemplateFactory->create($this->request);
$view->assignMultiple([
'activeFilter' => $filter,
'activeBlogSetup' => $blogSetup,
'commentCounts' => [
Expand All @@ -120,10 +118,8 @@ public function commentsAction(string $filter = null, int $blogSetup = null): Re
'blogSetups' => $this->setupService->determineBlogSetups(),
'comments' => $this->commentRepository->findAllByFilter($filter, $blogSetup),
]);
$moduleTemplate = $this->moduleTemplateFactory->create($this->request);
$moduleTemplate->setContent($this->view->render());

return $this->htmlResponse($moduleTemplate->renderContent());
return $view->renderResponse('Backend/Comments');
}

public function updateCommentStatusAction(string $status, string $filter = null, int $blogSetup = null, array $comments = [], int $comment = null): ResponseInterface
Expand Down Expand Up @@ -164,7 +160,7 @@ public function createBlogAction(array $data = null): ResponseInterface
if ($data !== null && $this->setupService->createBlogSetup($data)) {
$this->addFlashMessage('Your blog setup has been created.', 'Congratulation');
} else {
$this->addFlashMessage('Sorry, your blog setup could not be created.', 'An error occurred', FlashMessage::ERROR);
$this->addFlashMessage('Sorry, your blog setup could not be created.', 'An error occurred', ContextualFeedbackSeverity::ERROR);
}

return new RedirectResponse($this->uriBuilder->reset()->uriFor('setupWizard'));
Expand Down
8 changes: 4 additions & 4 deletions Classes/Controller/PostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function __construct(
}

/**
* @param ViewInterface|\TYPO3\CMS\Extbase\Mvc\View\ViewInterface $view
* @param ViewInterface $view
*/
protected function initializeView($view): void
{
Expand Down Expand Up @@ -94,14 +94,14 @@ protected function initializeView($view): void
$feedData = [
'title' => LocalizationUtility::translate('feed.title' . $action, 'blog', $arguments),
'description' => LocalizationUtility::translate('feed.description' . $action, 'blog', $arguments),
'language' => $this->getSiteLanguage()->getTwoLetterIsoCode(),
'language' => $this->getSiteLanguage()->getLocale()->getLanguageCode(),
'link' => $this->getRequestUrl(),
'date' => date('r'),
];
$this->view->assign('feed', $feedData);
}

$contentObject = $this->configurationManager->getContentObject();
$contentObject = $this->request->getAttribute('currentContentObject');
$this->view->assign('data', $contentObject !== null ? $contentObject->data : null);
}

Expand Down Expand Up @@ -185,7 +185,7 @@ public function listPostsByDateAction(?int $year = null, ?int $month = null, int
public function listPostsByCategoryAction(?Category $category = null, int $currentPage = 1): ResponseInterface
{
if ($category === null) {
$contentObject = $this->configurationManager->getContentObject();
$contentObject = $this->request->getAttribute('currentContentObject');
$referenceUid = $contentObject !== null ? (int) $contentObject->data['uid'] : null;
if ($referenceUid !== null) {
$categories = $this->categoryRepository->getByReference('tt_content', $referenceUid);
Expand Down
7 changes: 4 additions & 3 deletions Classes/Controller/WidgetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
use T3G\AgencyPack\Blog\Domain\Repository\TagRepository;
use T3G\AgencyPack\Blog\Service\CacheService;
use T3G\AgencyPack\Blog\Utility\ArchiveUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;

class WidgetController extends ActionController
Expand All @@ -44,7 +43,8 @@ public function __construct(

public function categoriesAction(): ResponseInterface
{
$requestParameters = GeneralUtility::_GP('tx_blog_category');
// @todo allow post?
$requestParameters = $this->request->getQueryParams()['tx_blog_category'] ?? [];
$currentCategory = 0;
if (($requestParameters['category'] ?? null) !== null) {
$currentCategory = (int)$requestParameters['category'];
Expand All @@ -60,7 +60,8 @@ public function categoriesAction(): ResponseInterface

public function tagsAction(): ResponseInterface
{
$requestParameters = GeneralUtility::_GP('tx_blog_tag');
// @todo allow post?
$requestParameters = $this->request->getQueryParams()['tx_blog_tag'] ?? [];
$currentTag = 0;
if (($requestParameters['tag'] ?? null) !== null) {
$currentTag = (int)$requestParameters['tag'];
Expand Down
3 changes: 2 additions & 1 deletion Classes/Domain/Factory/CommentFormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

namespace T3G\AgencyPack\Blog\Domain\Factory;

use Psr\Http\Message\ServerRequestInterface;
use T3G\AgencyPack\Blog\Domain\Finisher\CommentFormFinisher;
use T3G\AgencyPack\Blog\Domain\Validator\GoogleCaptchaValidator;
use TYPO3\CMS\Core\Information\Typo3Version;
Expand All @@ -35,7 +36,7 @@
* This example build a FormDefinition manually,
* so $configuration and $prototypeName are unused.
*/
public function build(array $configuration, string $prototypeName = null): FormDefinition
public function build(array $configuration, ?string $prototypeName = null, ?ServerRequestInterface $request = null): FormDefinition
{
$prototypeName = 'standard';
$formConfigurationService = GeneralUtility::makeInstance(ConfigurationService::class);
Expand Down Expand Up @@ -118,7 +119,7 @@
return $form;
}

protected function getTypoScriptFrontendController(): TypoScriptFrontendController

Check failure on line 122 in Classes/Domain/Factory/CommentFormFactory.php

View workflow job for this annotation

GitHub Actions / Build PHP (^13, 8.2, 8.4)

Return type of method T3G\AgencyPack\Blog\Domain\Factory\CommentFormFactory::getTypoScriptFrontendController() has typehint with deprecated class TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController: since TYPO3 v13, will vanish during v14 development. There are some remaining internal usages that can be adapted without further .rst files. The class should vanish together with $GLOBALS['TSFE'] in v14.

Check failure on line 122 in Classes/Domain/Factory/CommentFormFactory.php

View workflow job for this annotation

GitHub Actions / Build PHP (^13, 8.3, 8.0)

Return type of method T3G\AgencyPack\Blog\Domain\Factory\CommentFormFactory::getTypoScriptFrontendController() has typehint with deprecated class TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController: since TYPO3 v13, will vanish during v14 development. There are some remaining internal usages that can be adapted without further .rst files. The class should vanish together with $GLOBALS['TSFE'] in v14.

Check failure on line 122 in Classes/Domain/Factory/CommentFormFactory.php

View workflow job for this annotation

GitHub Actions / Build PHP (^13, 8.2, 8.0)

Return type of method T3G\AgencyPack\Blog\Domain\Factory\CommentFormFactory::getTypoScriptFrontendController() has typehint with deprecated class TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController: since TYPO3 v13, will vanish during v14 development. There are some remaining internal usages that can be adapted without further .rst files. The class should vanish together with $GLOBALS['TSFE'] in v14.

Check failure on line 122 in Classes/Domain/Factory/CommentFormFactory.php

View workflow job for this annotation

GitHub Actions / Build PHP (^13, 8.3, 8.4)

Return type of method T3G\AgencyPack\Blog\Domain\Factory\CommentFormFactory::getTypoScriptFrontendController() has typehint with deprecated class TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController: since TYPO3 v13, will vanish during v14 development. There are some remaining internal usages that can be adapted without further .rst files. The class should vanish together with $GLOBALS['TSFE'] in v14.

Check failure on line 122 in Classes/Domain/Factory/CommentFormFactory.php

View workflow job for this annotation

GitHub Actions / Build PHP (^13, 8.2, 8.4)

Return type of method T3G\AgencyPack\Blog\Domain\Factory\CommentFormFactory::getTypoScriptFrontendController() has typehint with deprecated class TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController: since TYPO3 v13, will vanish during v14 development. There are some remaining internal usages that can be adapted without further .rst files. The class should vanish together with $GLOBALS['TSFE'] in v14.

Check failure on line 122 in Classes/Domain/Factory/CommentFormFactory.php

View workflow job for this annotation

GitHub Actions / Build PHP (^13, 8.3, 8.4)

Return type of method T3G\AgencyPack\Blog\Domain\Factory\CommentFormFactory::getTypoScriptFrontendController() has typehint with deprecated class TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController: since TYPO3 v13, will vanish during v14 development. There are some remaining internal usages that can be adapted without further .rst files. The class should vanish together with $GLOBALS['TSFE'] in v14.

Check failure on line 122 in Classes/Domain/Factory/CommentFormFactory.php

View workflow job for this annotation

GitHub Actions / Build PHP (^13, 8.3, 8.0)

Return type of method T3G\AgencyPack\Blog\Domain\Factory\CommentFormFactory::getTypoScriptFrontendController() has typehint with deprecated class TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController: since TYPO3 v13, will vanish during v14 development. There are some remaining internal usages that can be adapted without further .rst files. The class should vanish together with $GLOBALS['TSFE'] in v14.

Check failure on line 122 in Classes/Domain/Factory/CommentFormFactory.php

View workflow job for this annotation

GitHub Actions / Build PHP (^13, 8.2, 8.0)

Return type of method T3G\AgencyPack\Blog\Domain\Factory\CommentFormFactory::getTypoScriptFrontendController() has typehint with deprecated class TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController: since TYPO3 v13, will vanish during v14 development. There are some remaining internal usages that can be adapted without further .rst files. The class should vanish together with $GLOBALS['TSFE'] in v14.
{
return $GLOBALS['TSFE'];
}
Expand Down
8 changes: 4 additions & 4 deletions Classes/Domain/Finisher/CommentFormFinisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
use T3G\AgencyPack\Blog\Notification\NotificationManager;
use T3G\AgencyPack\Blog\Service\CacheService;
use T3G\AgencyPack\Blog\Service\CommentService;
use TYPO3\CMS\Core\Messaging\AbstractMessage;
use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Messaging\FlashMessageService;
use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use TYPO3\CMS\Extbase\Service\ExtensionService;
Expand All @@ -36,17 +36,17 @@ class CommentFormFinisher extends AbstractFinisher
CommentService::STATE_ERROR => [
'title' => 'message.addComment.error.title',
'text' => 'message.addComment.error.text',
'severity' => AbstractMessage::ERROR,
'severity' => ContextualFeedbackSeverity::ERROR,
],
CommentService::STATE_MODERATION => [
'title' => 'message.addComment.moderation.title',
'text' => 'message.addComment.moderation.text',
'severity' => AbstractMessage::INFO,
'severity' => ContextualFeedbackSeverity::INFO,
],
CommentService::STATE_SUCCESS => [
'title' => 'message.addComment.success.title',
'text' => 'message.addComment.success.text',
'severity' => AbstractMessage::OK,
'severity' => ContextualFeedbackSeverity::OK,
],
];

Expand Down
6 changes: 4 additions & 2 deletions Classes/Domain/Model/Author.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ public function initializeObject(): void

public function getAvatarProvider(): AvatarProviderInterface
{
$avatarProvider = trim($this->avatarProvider) !== ''
? GeneralUtility::makeInstance($this->avatarProvider)
/** @var class-string<object>|'' $avatarProviderClassName */
$avatarProviderClassName = trim($this->avatarProvider);
$avatarProvider = $avatarProviderClassName !== ''
? GeneralUtility::makeInstance($avatarProviderClassName)
: GeneralUtility::makeInstance(GravatarProvider::class);

if (!$avatarProvider instanceof AvatarProviderInterface) {
Expand Down
6 changes: 5 additions & 1 deletion Classes/Domain/Repository/PostRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,11 @@
if ($i === $limit) {
break;
}
$posts->attach($this->findByUid($selectedPost));
$post = $this->findByUid($selectedPost);
if ($post === null) {
continue;
}
$posts->attach($post);
$i++;
}

Expand Down Expand Up @@ -447,7 +451,7 @@
return $pids;
}

protected function getTypoScriptFrontendController(): ?TypoScriptFrontendController

Check failure on line 454 in Classes/Domain/Repository/PostRepository.php

View workflow job for this annotation

GitHub Actions / Build PHP (^13, 8.2, 8.4)

Return type of method T3G\AgencyPack\Blog\Domain\Repository\PostRepository::getTypoScriptFrontendController() has typehint with deprecated class TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController: since TYPO3 v13, will vanish during v14 development. There are some remaining internal usages that can be adapted without further .rst files. The class should vanish together with $GLOBALS['TSFE'] in v14.

Check failure on line 454 in Classes/Domain/Repository/PostRepository.php

View workflow job for this annotation

GitHub Actions / Build PHP (^13, 8.3, 8.0)

Return type of method T3G\AgencyPack\Blog\Domain\Repository\PostRepository::getTypoScriptFrontendController() has typehint with deprecated class TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController: since TYPO3 v13, will vanish during v14 development. There are some remaining internal usages that can be adapted without further .rst files. The class should vanish together with $GLOBALS['TSFE'] in v14.

Check failure on line 454 in Classes/Domain/Repository/PostRepository.php

View workflow job for this annotation

GitHub Actions / Build PHP (^13, 8.2, 8.0)

Return type of method T3G\AgencyPack\Blog\Domain\Repository\PostRepository::getTypoScriptFrontendController() has typehint with deprecated class TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController: since TYPO3 v13, will vanish during v14 development. There are some remaining internal usages that can be adapted without further .rst files. The class should vanish together with $GLOBALS['TSFE'] in v14.

Check failure on line 454 in Classes/Domain/Repository/PostRepository.php

View workflow job for this annotation

GitHub Actions / Build PHP (^13, 8.3, 8.4)

Return type of method T3G\AgencyPack\Blog\Domain\Repository\PostRepository::getTypoScriptFrontendController() has typehint with deprecated class TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController: since TYPO3 v13, will vanish during v14 development. There are some remaining internal usages that can be adapted without further .rst files. The class should vanish together with $GLOBALS['TSFE'] in v14.

Check failure on line 454 in Classes/Domain/Repository/PostRepository.php

View workflow job for this annotation

GitHub Actions / Build PHP (^13, 8.2, 8.4)

Return type of method T3G\AgencyPack\Blog\Domain\Repository\PostRepository::getTypoScriptFrontendController() has typehint with deprecated class TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController: since TYPO3 v13, will vanish during v14 development. There are some remaining internal usages that can be adapted without further .rst files. The class should vanish together with $GLOBALS['TSFE'] in v14.

Check failure on line 454 in Classes/Domain/Repository/PostRepository.php

View workflow job for this annotation

GitHub Actions / Build PHP (^13, 8.3, 8.4)

Return type of method T3G\AgencyPack\Blog\Domain\Repository\PostRepository::getTypoScriptFrontendController() has typehint with deprecated class TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController: since TYPO3 v13, will vanish during v14 development. There are some remaining internal usages that can be adapted without further .rst files. The class should vanish together with $GLOBALS['TSFE'] in v14.

Check failure on line 454 in Classes/Domain/Repository/PostRepository.php

View workflow job for this annotation

GitHub Actions / Build PHP (^13, 8.3, 8.0)

Return type of method T3G\AgencyPack\Blog\Domain\Repository\PostRepository::getTypoScriptFrontendController() has typehint with deprecated class TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController: since TYPO3 v13, will vanish during v14 development. There are some remaining internal usages that can be adapted without further .rst files. The class should vanish together with $GLOBALS['TSFE'] in v14.

Check failure on line 454 in Classes/Domain/Repository/PostRepository.php

View workflow job for this annotation

GitHub Actions / Build PHP (^13, 8.2, 8.0)

Return type of method T3G\AgencyPack\Blog\Domain\Repository\PostRepository::getTypoScriptFrontendController() has typehint with deprecated class TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController: since TYPO3 v13, will vanish during v14 development. There are some remaining internal usages that can be adapted without further .rst files. The class should vanish together with $GLOBALS['TSFE'] in v14.
{
return $GLOBALS['TSFE'] ?? null;
}
Expand Down
9 changes: 6 additions & 3 deletions Classes/Domain/Validator/GoogleCaptchaValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@ class GoogleCaptchaValidator extends AbstractValidator
{
protected $acceptsEmptyValues = false;

public function isValid($value): void
public function isValid(mixed $value): void
{
$action = 'form';
$controller = 'Comment';
$settings = GeneralUtility::makeInstance(ConfigurationManagerInterface::class)
->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS, 'blog');
$requestData = GeneralUtility::_GPmerged('tx_blog_commentform');
$request = $this->request ?? $GLOBALS['TYPO3_REQUEST'];
$queryArguments = $request->getQueryParams();
$bodyData = $request->getParsedBody();
$requestData = $queryArguments['tx_blog_commentform'] ?? [];

if (
// this validator is called multiple times, if the first success,
Expand All @@ -41,7 +44,7 @@ public function isValid($value): void
'headers' => ['Content-type' => 'application/x-www-form-urlencoded'],
'query' => [
'secret' => $settings['comments']['google_recaptcha']['secret_key'],
'response' => GeneralUtility::_GP('g-recaptcha-response'),
'response' => $bodyData['g-recaptcha-response'] ?? '',
'remoteip' => GeneralUtility::getIndpEnv('REMOTE_ADDR')
]
];
Expand Down
Loading
Loading