#104803Workspace Preview URL not working in conjuction with TCEMAIN.preview.TABLENAME.fieldToParameterMap & additionalGetParameters
Description
From Workspace version 12.4.10 to 12.4.11 and 12.4.12 something weird happens with previewing records in a workspace environment.
For this example I’ve debugged the $_GET parameters available in my controller when building the detail view of a record.
12.4.10 -> Everything works (not as intended as you will see, but it makes it solvable)
You notice that in the “id” Parameter there are simply 2 different values -> 89 (previewPageId) and tx_foo[service]=346 (fieldToParameterMap: uid=tx_foo[service]) merged together (The reason this happens is, that the URL is not correctly build:
https://test.ddev.site/typo3/workspace/preview-control/?token=f5cdf01065fd98a1f1d154f7885b67f0705ccdad&id=89tx_foo%5Bservice%5D=348&tx_alzey_services%5Baction%5D=detail
Its missing the “&” after 89 e.G.
12.4.11 -> Suddenly in a workspace environment the preview is no longer accessible duo to 404 Error message
12.4.12 -> There is no longer a merged value as mentioned in 12.4.10 with 89 (previewPageId) and tx_foo[service]=346 (fieldToParameterMap: uid=tx_foo[service]), it simply doesn’t show up anymore and also all request Parameters are empty aswell so I dont have a way to get the ID of my tx_foo[service] unless I’m willing to substring the URL where the ID is clearly present.
https://test.ddev.site/typo3/workspace/preview-control/?token=ce427a788e31e179c47325b37d43154babc31af2&id=89&tx_foo%5Bservice%5D=367&tx_alzey_services%5Baction%5D=detail
Here the mentioned missing “&” after 89 is present, but its missing a “=” after “tx_foo”, since %5Bservice%5D is [service] (escaped).
Manually adding a “=” after “tx_foo” makes the $_GET Parameter accessible.
Previews all work flawlessly if I’m previewing without a workspace!
TSConfig for Preview Link Building:
TCEMAIN {
preview {
disableButtonForDokType = 199, 254, 255, 103
tx_foo {
previewPageId = {$serviceDetails} // 89
useDefaultLanguageRecord = 1
fieldToParameterMap {
uid = tx_foo[service]
}
additionalGetParameters {
tx_foo.action = detail
}
}
}
}Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Files 3
History 3
-
Marius Förg commented <span data-processor="relativetime" data-value="2025-03-12T13:05:36+00:00" > 03/12/25, 13:05 </span>
As of 12.4.27 it seems to work again. Must have had something to do with redirects bugfixes since I cant see any related fix in cms-workspaces extension. Can be closed.
-
Georg Ringer commented and changed status
NewClosed <span data-processor="relativetime" data-value="2025-04-16T07:46:00+00:00" > 04/16/25, 07:46 </span>closed as requested
Marius Förg wrote:
> From Workspace version 12.4.10 to 12.4.11 and 12.4.12 something weird happens with previewing records in a workspace environment.
>
> For this example I’ve debugged the $_GET parameters available in my controller when building the detail view of a record.
>
> 12.4.10 -> Everything works (not as intended as you will see, but it makes it solvable)
> You notice that in the “id” Parameter there are simply 2 different values -> 89 (previewPageId) and tx_foo[service]=346 (fieldToParameterMap: uid=tx_foo[service]) merged together (The reason this happens is, that the URL is not correctly build:
> https://test.ddev.site/typo3/workspace/preview-control/?token=f5cdf01065fd98a1f1d154f7885b67f0705ccdad&id=89tx_foo%5Bservice%5D=348&tx_alzey_services%5Baction%5D=detail
> Its missing the “&” after 89 e.G.
>
> 12.4.11 -> Suddenly in a workspace environment the preview is no longer accessible duo to 404 Error message
>
> 12.4.12 -> There is no longer a merged value as mentioned in 12.4.10 with 89 (previewPageId) and tx_foo[service]=346 (fieldToParameterMap: uid=tx_foo[service]), it simply doesn’t show up anymore and also all request Parameters are empty aswell so I dont have a way to get the ID of my tx_foo[service] unless I’m willing to substring the URL where the ID is clearly present.
> https://test.ddev.site/typo3/workspace/preview-control/?token=ce427a788e31e179c47325b37d43154babc31af2&id=89&tx_foo%5Bservice%5D=367&tx_alzey_services%5Baction%5D=detail
> Here the mentioned missing “&” after 89 is present, but its missing a “=” after “tx_foo”, since %5Bservice%5D is [service] (escaped).
> Manually adding a “=” after “tx_foo” makes the $_GET Parameter accessible.
>
>
> Previews all work flawlessly if I’m previewing without a workspace!
>
> TSConfig for Preview Link Building:
>
> TCEMAIN {
> preview {
> disableButtonForDokType = 199, 254, 255, 103
> tx_foo {
> previewPageId = {$serviceDetails} // 89
> useDefaultLanguageRecord = 1
> fieldToParameterMap {
> uid = tx_foo[service]
> }
>
> additionalGetParameters {
> tx_foo.action = detail
> }
> }
> }
> }