Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Load only LIVE records in checkIfPageIsHidden #380

Closed
wants to merge 1 commit into from

Conversation

smichaelsen
Copy link
Contributor

The checkIfPageIsHidden queries the page and afterwards performs the workspace overlay.
However the first query can also load workspaced records, because the restriction is missing, which means changes in the workspace can affect the preview functionality of LIVE.
Most of the times this won't break, because of the LIMIT 1 and normally in the database the WS records will be stored after the LIVE record.

We first identified this bug in TYPO3 v10, where this bug is in TypoScriptFrontendController: https://github.com/TYPO3/typo3/blob/11.5/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php#L852
There you can see there is a check for pid > 0 in the query which is the legacy way of saying "no workspace version".

The `checkIfPageIsHidden` queries the page and afterwards performs the workspace overlay.
However the first query can also load workspaced records, because the restriction is missing, which means changes in the workspace can affect the preview functionality of LIVE.
Most of the times this won't break, because of the `LIMIT 1` and normally in the database the WS records will be stored after the LIVE record.

We first identified this bug in TYPO3 v10, where this bug is in `TypoScriptFrontendController`: https://github.com/TYPO3/typo3/blob/11.5/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php#L852
There you can see there is a check for `pid > 0` in the query which is the legacy way of saying "no workspace version".
@TYPO3IncTeam
Copy link

Thank you for your contribution to TYPO3. We are using Gerrit Code Review for our contributions and took the liberty to convert your pull request to a review in our review system.
You can find your patch at: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74680
For further information on how to contribute have a look at https://docs.typo3.org/typo3cms/ContributionWorkflowGuide/

@TYPO3 TYPO3 locked and limited conversation to collaborators May 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants