Skip to content

Commit

Permalink
[BUGFIX] Fix post preview functionality
Browse files Browse the repository at this point in the history
Missing argument type breaks preview in TYPO3 v12.
  • Loading branch information
fnagel committed Dec 5, 2023
1 parent 0fc659e commit 8dd4a24
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Classes/Controller/PostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,14 +215,15 @@ public function showAction(Post $post, int $page = 1, Comment $newComment = null
/**
* Preview a post.
*/
public function previewAction($previewPost): ResponseInterface
public function previewAction(int $previewPost): ResponseInterface
{
if (!FrontendUtility::isValidBackendUser()) {
throw new AccessDeniedException('Preview not allowed.');
}

if (is_int($previewPost)) {
$post = $this->postRepository->findByUid($previewPost, false);
$post = $this->postRepository->findByUid($previewPost, false);

if ($post instanceof Post) {
return (new ForwardResponse('show'))->withArguments(['post' => $post]);
}

Expand Down
1 change: 1 addition & 0 deletions Documentation/DeveloperGuide/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ https://extensions.typo3.org/extension/introduction
**What needs to be tested:**

* Creating blog posts (with and without preview image and text)
* Check post preview
* Posting comments and subscribe for new comments
* With and without SPAM check triggered
* Test field validation
Expand Down

0 comments on commit 8dd4a24

Please sign in to comment.