Project

General

Profile

Actions

Bug #104803

open

Workspace Preview URL not working in conjuction with TCEMAIN.preview.TABLENAME.fieldToParameterMap & additionalGetParameters

Added by Marius Förg 3 months ago. Updated 3 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Workspaces
Target version:
-
Start date:
2024-09-03
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

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
}
}
}
}

Files

TYPO3_12.4.10.png (23.1 KB) TYPO3_12.4.10.png Marius Förg, 2024-09-03 12:00
TYPO3_12.4.11.png (98.9 KB) TYPO3_12.4.11.png Marius Förg, 2024-09-03 12:00
TYPO3_12.4.12.png (11.7 KB) TYPO3_12.4.12.png Marius Förg, 2024-09-03 12:00
Actions #1

Updated by Marius Förg 3 months ago

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
}
}
}
}

Actions

Also available in: Atom PDF