Skip to content

Commit

Permalink
[BUGFIX] Change Middleware registration order for the Crawler to avo…
Browse files Browse the repository at this point in the history
…id problems wiht ext:StaticFileCache

Resolves: #642 and lochmueller/staticfilecache#260
  • Loading branch information
tomasnorre authored Nov 15, 2020
1 parent 2299e99 commit 0f7cb6a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* Updated Rector, PHPStan, ECS for better static code analysis
* BackendModule is splittet into smaller classes to improve readability and maintainability
* Crawler Class added, this can be used to check whether the crawler is enabled or disabled
* aoe/crawler/initialization (middleware) is moved to before typo3/cms-core/normalizedParams to have crawler being "last" in middleware chain

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion Classes/Backend/RequestForm/LogRequestForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ private function drawLog_addRows(array $logEntriesOfPage, string $titleString):

$trClass = '';
$warningIcon = '';
if ($rowData['exec_time'] !== 0 && $resultData === false) {
if (str_contains($resStatus, 'Error:')) {
$trClass = 'class="bg-danger"';
$warningIcon = $this->getIconFactory()->getIcon('actions-ban', Icon::SIZE_SMALL);
}
Expand Down
5 changes: 1 addition & 4 deletions Configuration/RequestMiddlewares.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@
],
'aoe/crawler/initialization' => [
'target' => CrawlerInitialization::class,
'after' => [
'typo3/cms-frontend/tsfe',
],
'before' => [
'typo3/cms-frontend/prepare-tsfe-rendering',
'typo3/cms-core/normalizedParams',
],
],
],
Expand Down
11 changes: 3 additions & 8 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ parameters:
path: Classes/Backend/Helper/ResultHandler.php

-
message: "#^Class cognitive complexity for \"LogRequestForm\" is 68, keep it under 50$#"
message: "#^Class cognitive complexity for \"LogRequestForm\" is 67, keep it under 50$#"
count: 1
path: Classes/Backend/RequestForm/LogRequestForm.php

-
message: "#^Class cognitive complexity for \"LogRequestForm\" is 68, keep it under 60$#"
message: "#^Class cognitive complexity for \"LogRequestForm\" is 67, keep it under 60$#"
count: 1
path: Classes/Backend/RequestForm/LogRequestForm.php

Expand Down Expand Up @@ -86,7 +86,7 @@ parameters:
path: Classes/Backend/RequestForm/LogRequestForm.php

-
message: "#^Cognitive complexity for \"AOE\\\\Crawler\\\\Backend\\\\RequestForm\\\\LogRequestForm\\:\\:drawLog_addRows\\(\\)\" is 41, keep it under 8$#"
message: "#^Cognitive complexity for \"AOE\\\\Crawler\\\\Backend\\\\RequestForm\\\\LogRequestForm\\:\\:drawLog_addRows\\(\\)\" is 40, keep it under 8$#"
count: 1
path: Classes/Backend/RequestForm/LogRequestForm.php

Expand Down Expand Up @@ -115,11 +115,6 @@ parameters:
count: 1
path: Classes/Backend/RequestForm/LogRequestForm.php

-
message: "#^Offset 'exec_time' does not exist on array\\('result_log' \\=\\> string, 'result_status' \\=\\> string, 'url' \\=\\> string, 'feUserGroupList' \\=\\> mixed, 'procInstructions' \\=\\> string, 'set_id' \\=\\> string, \\?'tsfe_id' \\=\\> mixed, \\?'tsfe_gr_list' \\=\\> mixed, \\.\\.\\.\\)\\|array\\('scheduled' \\=\\> string, 'exec_time' \\=\\> string, 'result_status' \\=\\> string, 'url' \\=\\> string, 'feUserGroupList' \\=\\> mixed, 'procInstructions' \\=\\> string, 'set_id' \\=\\> string, \\?'tsfe_id' \\=\\> mixed, \\.\\.\\.\\)\\.$#"
count: 1
path: Classes/Backend/RequestForm/LogRequestForm.php

-
message: "#^Parameter \\#2 \\$pieces of function implode expects array, array\\<int, string\\>\\|false given\\.$#"
count: 1
Expand Down

0 comments on commit 0f7cb6a

Please sign in to comment.