Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Changelog
All notable changes to this extension will be documented in this file.

## [13.0.4] - 2025-09-02
## [13.0.5] - 2025-09-08
### Fixed
- Fixed navigation error when clearing cache while impersonating a backend user.

## [13.0.4] - 2025-09-02
### Fixed
- Fixed cache invalidation bug when creating or deleting a page.
11 changes: 5 additions & 6 deletions Classes/Cache/CloudFrontCacheManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
use TYPO3\CMS\Core\Resource\Folder;
use TYPO3\CMS\Core\Resource\File;
use TYPO3\CMS\Core\Resource\ProcessedFile;

use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Database\Connection;
Expand Down Expand Up @@ -68,7 +67,7 @@ public function fileMod(Folder|File|ProcessedFile $resource): void
$this->clearCache();

$errorMessage = 'fileMod distributionsIds : ' . $distributionIds . ' resource identifier : ' . $resource->getIdentifier() . ' wildcard : ' . $wildcard;
$GLOBALS['BE_USER']->writelog(4, 0, 0, 0, $errorMessage, "tm_cloudfront");
$GLOBALS['BE_USER']->writelog(4, 0, 0, 0, $errorMessage, ["ext" => "tm_cloudfront"]);

// Reset the queue after processing for testing purposes
$this->resetQueue();
Expand Down Expand Up @@ -164,7 +163,7 @@ public function clearCache()
} catch (\Exception $e) {
// log error: could not create invalidation
$errorMessage = 'Could not create invalidation for distribution ID ' . $distId . ': ' . $e->getMessage();
$GLOBALS['BE_USER']->writelog(4, 0, 0, 0, $errorMessage, "tm_cloudfront");
$GLOBALS['BE_USER']->writelog(4, 0, 0, 0, $errorMessage, ["ext" => "tm_cloudfront"]);
}
} else {
foreach ($paths as $k => $value) {
Expand Down Expand Up @@ -232,7 +231,7 @@ public function resolveDistributionIds(): array
public function queueClearCache(int $pageId, bool $recursive = false, string|null $distributionIds = null)
{
$errorMessage = 'queueClearCache $pageId: ' . $pageId . ' recursive: ' . $recursive . ' distributionIds: ' . $distributionIds;
$GLOBALS['BE_USER']->writelog(4, 0, 0, 0, $errorMessage, "tm_cloudfront");
$GLOBALS['BE_USER']->writelog(4, 0, 0, 0, $errorMessage, ["ext" => "tm_cloudfront"]);

$wildcard = '';
if ($recursive) {
Expand Down Expand Up @@ -262,12 +261,12 @@ public function queueClearCache(int $pageId, bool $recursive = false, string|nul
} else {
$this->enqueue($this->buildLink($entry, array('_language' => 0)) . $wildcard, $distributionIds);
$errorMessage = 'queueClearCache enque lang: 0 distributionIds: ' . $distributionIds;
$GLOBALS['BE_USER']->writelog(4, 0, 0, 0, $errorMessage, "tm_cloudfront");
$GLOBALS['BE_USER']->writelog(4, 0, 0, 0, $errorMessage, ["ext" => "tm_cloudfront"]);
foreach ($languages as $k => $lang) {
if ($lang->getLanguageId() != 0) {
$this->enqueue($this->buildLink($entry, array('_language' => $lang->getLanguageId())) . $wildcard, $distributionIds);
$errorMessage = 'queueClearCache enque lang: ' . $lang->getLanguageId() . ' distributionIds: ' . $distributionIds;
$GLOBALS['BE_USER']->writelog(4, 0, 0, 0, $errorMessage, "tm_cloudfront");
$GLOBALS['BE_USER']->writelog(4, 0, 0, 0, $errorMessage, ["ext" => "tm_cloudfront"]);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions Classes/Hooks/ClearCachePostProc.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function clearCachePostProc(&$params, &$pObj): void
'clearCachePostProc cacheCmd: ' . $uid_page .
' distributionIds: ' . $distributionIds .
' domains: ' . implode(',', $domains),
"tm_cloudfront"
["ext" => "tm_cloudfront"]
);

$this->cacheManager->cacheCmd($params, $distributionIds);
Expand Down Expand Up @@ -149,7 +149,7 @@ public function clearCachePostProc(&$params, &$pObj): void
0,
0,
'clearCachePostProc table: ' . $table . ' distributionIds: ' . $distributionIds,
"tm_cloudfront"
["ext" => "tm_cloudfront"]
);
}

Expand Down Expand Up @@ -208,7 +208,7 @@ protected function getDistributionIds(int $uid_page, array $params): string
0,
0,
'Get DistributionIds : ' . $distributionIds,
"tm_cloudfront"
["ext" => "tm_cloudfront"]
);

return $distributionIds;
Expand Down
4 changes: 2 additions & 2 deletions Classes/Task/ClearTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ protected function cc($pathsegments, $uids, $distId)
]
]
]);
$GLOBALS['BE_USER']->writelog(4, 0, 0, 0, 'successful invalidation paths :' . implode(', ', $pathsegments) . ' (' . $distId . ').', "tm_cloudfront");
$GLOBALS['BE_USER']->writelog(4, 0, 0, 0, 'successful invalidation paths :' . implode(', ', $pathsegments) . ' (' . $distId . ').', ["ext" => "tm_cloudfront"]);
$queryBuilder->delete('tx_tmcloudfront_domain_model_invalidation')->where($queryBuilder->expr()->in('uid', $uids))->executeStatement();
} catch (\Exception $e) {
print_r($e->getMessage());
$GLOBALS['BE_USER']->writelog(4, 0, 0, 0, 'exception for invalidation paths :' . implode(', ', $pathsegments) . ' (' . $distId . ').', "tm_cloudfront");
$GLOBALS['BE_USER']->writelog(4, 0, 0, 0, 'exception for invalidation paths :' . implode(', ', $pathsegments) . ' (' . $distId . ').', ["ext" => "tm_cloudfront"]);
}
}

Expand Down
2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
'author' => 'Simon Ouellet',
'author_email' => '',
'state' => 'beta',
'version' => '13.0.4',
'version' => '13.0.5',
'constraints' => [
'depends' => [
'typo3' => '12.4.0-13.5.99',
Expand Down