-
Notifications
You must be signed in to change notification settings - Fork 218
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
BUG: Render issue with <flux:content.render area="foo" /> in Workspace previews. #2158
Comments
I have encountered the same problem. As example, we have these Elements:
With this set, we render the preview element: // Classes/ViewHelpers/Content/GetViewHelper.php
if ($workspaceId) {
$placeholder = BackendUtility::getWorkspaceVersionOfRecord($workspaceId, 'tt_content', $record['uid'] ?? 0);
if ($placeholder) {
// Use the move placeholder if one exists, ensuring that "pid" and "tx_flux_parent" values are taken
// from the workspace-only placeholder.
/** @var array $record */
$record = $placeholder;
}
} Rendering the preview results in the child elements being searched by colPos 4301, 4302, 4303, ... (Again, because of So as a solution, i kept that information about the original record and used it then to also check for rows in this live record: diff --git a/Classes/ViewHelpers/Content/GetViewHelper.php b/Classes/ViewHelpers/Content/GetViewHelper.php
if ($workspaceId) {
$placeholder = BackendUtility::getWorkspaceVersionOfRecord($workspaceId, 'tt_content', $record['uid'] ?? 0);
if ($placeholder) {
// Use the move placeholder if one exists, ensuring that "pid" and "tx_flux_parent" values are taken
// from the workspace-only placeholder.
+ $liveRecord = $record;
/** @var array $record */
$record = $placeholder;
}
}
/** @var AbstractProvider $provider */
$provider = $renderingContext->getViewHelperVariableContainer()->get(FormViewHelper::class, 'provider');
$grid = $provider->getGrid($record);
$rows = static::getContentRecords($arguments, $record, $grid);
+if (isset($liveRecord) && $liveRecord['uid'] !== $record['uid']) {
+ array_push($rows, ...static::getContentRecords($arguments, $liveRecord, $grid));
+} This solves the issues, but im not sure whether thats the correct location to fix this. Maybe this can also be solved when saving the element. |
As described in Issue FluidTYPO3#2158 children are not rendered when previewing changes made in the preview workspace.
I am using Flux Grid to render a Header on my Website. I have a Flux Configuration that looks like this:
and rendering it like this:
I am also using the Typo3 Workspace Module.
The issue i am facing is that if i move or edit the Header in a workspace, the Header-Items are missing in the Preview.
Specifically
<flux:content.render area="headerItems" />
is not returning anything in the preview even tho there should be Header-Items.Steps to reproduce the behavior:
I tested this in Typo3 v11 and v12 and with every version of this extension, and all versions had this issue.
If more information is needed, i can also provide some screenshots or try to explain the problem further.
Thanks for the time you guys put into this project.
Simon
The text was updated successfully, but these errors were encountered: