Skip to content

PageNotFoundException in SetupService #325

@jmh-dreistrom-land

Description

@jmh-dreistrom-land

Bug Report

The determineBlogSetups method from SetupService determines all pages with the BLOG_POST doctype, including those from workspaces. If there is a newly created page with a subpage with the BLOG_POST doctype in a workspace that the backend user has not selected, a PageNotFoundException occurs in all blog modules.

Prerequisites

  • Can you reproduce the problem on TYPO3 v9.5 LTS -> not tested
  • Can you reproduce the problem on TYPO3 v10.4 LTS -> not tested
  • Can you reproduce the problem on TYPO3 v11.x
  • Can you reproduce the problem on TYPO3 v13.x
  • Did you perform a cursory search to see if your bug or feature is already reported?

Description

Based on the preliminary analysis, the bug occurs because in the determineBlogSetups method from the SetupService class, rootlines are to be created for pages that are not available in the currently selected workspace.

One way to fix the bug is to add a corresponding restriction to the $queryBuilder: $queryBuilder->getRestrictions()->add(GeneralUtility::makeInstance(WorkspaceRestriction::class, $GLOBALS['BE_USER']->workspace));

Steps to Reproduce

  1. switch to a workspace
  2. create a page, set it to visible
  3. create another page of the type (doktype) Blog Post [137] as a subpage of the first page created, set it to visible
  4. switch to the live workspace
  5. call up the Blog > Setup module

Expected behavior:

Actual behavior:

Image

Versions

  • 12.0.2
  • 13.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions