Bug #82462

Workspace : no content show in preview, for a new page create in workspace, if this page is enable

Added by shinsei san over 2 years ago. Updated about 1 month ago.

Status:
Under Review
Priority:
Must have
Assignee:
Category:
Workspaces
Target version:
-
Start date:
2017-09-12
Due date:
% Done:

0%

TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Install a typo3 v8.7.6

1) configure an template like this

page = PAGE
page.10 < styles.content.get

2) Create a workspace and use it
3) create a new page "Test"
4) on this page create a content on column 0
5) enable the page
6) Preview page

In this case the content of column 0 will NOT be show.

7) Disable the test page
8) Preview page

In this case the content of column 0 will BE be show.

This only append with a page create in workspace. if the page exists in live, you can edit it in workspace the content appears whether the page is active or not

bug_82462.diff View (1022 Bytes) Florian Rival, 2017-11-13 14:15


Related issues

Related to TYPO3 Core - Bug #85003: Workspace : no content show in preview frontend, if live page is hidden Closed 2018-05-14
Related to TYPO3 Core - Bug #83065: Content is disappearing in Page module in workspaces Closed 2017-11-22
Related to TYPO3 Core - Bug #85742: New page in workspace doesn't load content elements in preview Closed 2018-08-03
Related to TYPO3 Core - Bug #89455: Translations/Localized records are not visible in Workspace Preview Closed 2019-10-18
Related to TYPO3 Core - Bug #80995: Content of hidden page not shown in workspace preview Closed 2017-04-25

History

#1 Updated by Francois Suter over 2 years ago

As amazing at is may sound, I confirm that it is so. I was facing a blank page in a workspace preview and started looking for related bugs. Disabling my page made the content appear...

#2 Updated by R3 H6 over 2 years ago

Can confirm this problem and behavior.

#3 Updated by Florian Rival over 2 years ago

When working with workspaces, two pages are created with ID : X and X+1 but when the workspace page is updated (id x+1), the column hidden of the reference page (id x) is not updated. When we want to view this page, the process is looking for page content with page flag "hidden=0" but this page still has hidden flag set to 1 because it wasn't updated.
Here is a patch to update the hidden flag for reference page when workspace page is updated.

#4 Updated by Gabe Blair over 2 years ago

I can confirm this behavior in TYPO3 8.7.8. I tried Florian's patch, and it does appear to fix the issue (after starting over with the content edits). Should this be considered a regression?

#5 Updated by Patrick Gaumond about 2 years ago

Just tried the patch and it worked for us. TYPO3 8.7.10.

#6 Updated by Gerrit Code Review about 2 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55967

#7 Updated by Riccardo De Contardi about 2 years ago

Sorry wrong patch target commit. My apologies

#8 Updated by Oliver Hader about 2 years ago

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

#9 Updated by Gerrit Code Review over 1 year ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55967

#10 Updated by Gianluca Strafella over 1 year ago

The patch doesn't work for us. We've tried on TYPO3 8.7.20 (cleaned).

These the start conditions:
- In LIVE, page already published, but not visible (hidden=1)
- In WORKSPACE, the same page was modified adding a new content element

If the page in workspace is hidden as in LIVE, the new content is visible via preview and preview link.
If the page in workspace is visible (hidden=0), all contents in the page aren't visible.

We have found a possible problem in the TYPO3 core:

class: TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
method: determineIdIsHiddenPage

protected function determineIdIsHiddenPage()
{
   //...
   if ($workspace !== 0 && $workspace !== false) {
        // Fetch overlay of page if in workspace and check if it is hidden
        $pageSelectObject = GeneralUtility::makeInstance(PageRepository::class);
        $pageSelectObject->versioningPreview = true;
        $pageSelectObject->init(false);
        $targetPage = $pageSelectObject->getWorkspaceVersionOfRecord($this->whichWorkspace(), 'pages',
          $page['uid']);

        //>>>>>>> here a problem: in this case getWorkspaceVersionOfRecord return an array with ws page
        $result = $targetPage === -1 || $targetPage === -2 || (is_array($targetPage) && $targetPage['hidden'] == 0 && $page['hidden'] == 1);
        //<<<<<<
   } else {
       $result = is_array($page) && ($page['hidden'] || $page['starttime'] > $GLOBALS['SIM_EXEC_TIME'] || $page['endtime'] != 0 && $page['endtime'] <= $GLOBALS['SIM_EXEC_TIME']);
   }
}

As a work around, we fixed with this row:

$result = $targetPage === -1 || $targetPage === -2 || (is_array($targetPage) && $targetPage['hidden'] == 0 && $page['hidden'] == 1);

Gianluca

#11 Updated by Gerrit Code Review over 1 year ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55967

#12 Updated by Gerrit Code Review over 1 year ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55967

#13 Updated by Philip Burggraf over 1 year ago

The issue still exists in v9.5.4 and is reproducible with the exact same steps as in the initial bug report.
However, we've also encountered this issue when creating a new page in the workspace.

Steps to reproduce:
1. Create a workspace and use it
2. Create a new page
3. Add some content elements to the page
4. Enable the newly created page (Right click in the page tree on the page -> "Enable")
5. Preview the page (Right click in the page tree on the page -> "Show")

Result: The created content elements are not visible.

To get the expected result (be able to view the content elements) you must disable the page.
1. Disable the created page again (Right click in the page tree on the page -> "disable")
2. Reload the preview page

Result: The content elements are visible.

You'll be able to view the content elements, regardless if the page is enabled or not, if you apply the workaround from Gianluca Strafella.
Note: You must flush all caches after editing the TypoScriptFrontendController.

#14 Updated by Riccardo De Contardi about 1 year ago

  • Related to Bug #83065: Content is disappearing in Page module in workspaces added

#15 Updated by Riccardo De Contardi about 1 year ago

  • Related to Bug #85742: New page in workspace doesn't load content elements in preview added

#16 Updated by Riccardo De Contardi about 1 year ago

I report here my comment 6 on #83065 as a quick way to reproduce the issue on the latest master:

The issue is still present on 10.0.0-dev (latest master); it is easy to reproduce:

1) Have a plain TYPO3 installation
2) Create a draft Workspace
3) Create a page in the Workspace
4) Add a content element to the page
5) Save and preview the page

Expected result:

the content element should be visible in the preview

Current result

the content element is not visible.

if the page created in workspace is marked as hidden (disabled), then the content element becomes visible (tested with 10.0.0-dev).

Please note that #83065 had this review attached https://review.typo3.org/54724 that was abandoned.

#17 Updated by Riccardo De Contardi about 1 year ago

Please note that #85742 had this review attached https://review.typo3.org/57822 that was reverted with https://review.typo3.org/58838

#18 Updated by Anatoli Zich 11 months ago

Im not sure if i should open up a new bug but i think this is related:
This also applies to live pages with unmet start and expiration date conditions.

Steps to reproduce (TYPO3 8-10):
1) Have a plain TYPO3 installation
2) Create a draft Workspace
3) Create a page in live mode
4) Add a content element to that page
5) Set the expiration date of the page to something in the past and save
6) Switch to draft Workspace
7) Remove the expiration date from the page
8) Save and preview the page

Expected result:
You should be able to see page and its content elements.

Current result:
You'll be able to view the page but no content elements appear.

#19 Updated by Hannes Bochmann 10 months ago

The patch in this issue fixes the problem for this issue but not for the related #85003. The proposed patch of Gianluca fixes both issues. But as I stated in #85003 it seems to me that none of the patches tackle the right spot.

#20 Updated by Benni Mack 7 months ago

  • Related to Bug #89455: Translations/Localized records are not visible in Workspace Preview added

#21 Updated by Oliver Hader 6 months ago

  • Status changed from Under Review to On Hold

Handled in #89455 - once done, related issues should be re-evaluated again (then either to be closed or adjusted)

#22 Updated by Oliver Hader 6 months ago

  • Assignee set to Oliver Hader

#23 Updated by Riccardo De Contardi about 1 month ago

  • Related to Bug #80995: Content of hidden page not shown in workspace preview added

#24 Updated by Gerrit Code Review about 1 month ago

  • Status changed from On Hold to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64215

#25 Updated by Gerrit Code Review about 1 month ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64215

#26 Updated by Gerrit Code Review about 1 month ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64215

#27 Updated by Riccardo De Contardi about 1 month ago

If I repeat my test on comment 16, it looks like the issue is already resolved even without the patch (tested on latest master) ; am I wrong?

#28 Updated by Gerrit Code Review about 1 month ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64215

#29 Updated by Riccardo De Contardi about 1 month ago

Test on comment 18 still happens on latest master

Also available in: Atom PDF