Bug #88054

A content element visible in a workspace, is not visibile when it's hidden in LIVE

Added by Gianluca Strafella 5 months ago. Updated 4 months ago.

Status:
New
Priority:
Must have
Assignee:
-
Category:
Workspaces
Target version:
-
Start date:
2019-04-02
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
7.2
Tags:
workspace sorting
Complexity:
Is Regression:
Sprint Focus:

Description

Hi,
in these conditions:

1) Two (or more) content elements in a standard page, in LIVE:
Content-1: sorting=1, hidden=0
Content-2: sorting=2, hidden=1 (this content is not visibile in LIVE)

2) A user, in a workspace, actives "Content-2":
Content-1: sorting=1, hidden=0
Content-2: sorting=2, hidden=0 (content now showed in current workspace)

3) The same user, moves Content-2 above Content-1:
Content-1: sorting=2, hidden=0
Content-2: sorting=1, hidden=0 (content now showed in current workspace)

At this point, "Content-2" is not more visibile on frontend, also if is still visible (hidden=0).

I found a problem in class \TYPO3\CMS\Frontend\Page\PageRepository::movePlhOL

around first query:

//...
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table);

//this row exclude the live record because it is hidden in LIVE
$queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));

$origRow = $queryBuilder->select(...array_keys($this->purgeComputedProperties($row)))
//...

The FrontendRestrictionContainer include HiddenRestriction, but in this case, the content element is still hidden in LIVE.

As workaround, I patched the core, rewriting the class and overwriting the method, with this replacements:

//original statement
//$queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));

//replaced with
$queryBuilder->removeAll()
             ->add(GeneralUtility::makeInstance(DeletedRestriction::class))
             ->add(GeneralUtility::makeInstance(FrontendWorkspaceRestriction::class))
             ->add(GeneralUtility::makeInstance(StartTimeRestriction::class))
             ->add(GeneralUtility::makeInstance(EndTimeRestriction::class))
             ->add(GeneralUtility::makeInstance(FrontendGroupRestriction::class));

The problem has been replicated on these TYPO3 versions:
- TYPO3 8.7.24
- TYPO3 9.5

Thank you,
Gianluca


Related issues

Related to TYPO3 Core - Bug #85003: Workspace : no content show in preview frontend, if live page is hidden New 2018-05-14

History

#1 Updated by Robert Vock 4 months ago

The method getRecordOverlay also has this bug. It ignores hidden elements and does not load the overlay:
PageRepository.php:587

#2 Updated by Riccardo De Contardi 4 months ago

  • Related to Bug #85003: Workspace : no content show in preview frontend, if live page is hidden added

Also available in: Atom PDF