Issue Bug Closed

#77735Editing of content with image does not work in workspace

Robert Vock 09/01/16, 10:00 updated 10/02/18, 11:07

Description

When I try to edit a tt_content record with an image, I get the following exception:

#1437656456: $uid must be positive integer, 0 given

(Current master: 3523358c681dc86ee6bce44f67a6871b5eca5688)

Steps to reproduce:
1. Add an element with image in Live-Workspace
2. Change to Draft Workspace
3. Try to edit the record.

This happens, because there are no translated records of the sys_file_reference, when initially editing the record. Then TceInline::getWorkspacedUids will try to get the workspace uids of the images and performs and incorrect check:
https://github.com/TYPO3/TYPO3.CMS/blob/084bc6a6da568f010e0fc6af610893f8d6ff8b57/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaInline.php#L397

$workspaceVersion is null instead of false.

This bug was introduced with #75650:
https://github.com/TYPO3/TYPO3.CMS/commit/e615411ba877dcde9c032324d3a6f7a03a711b97#diff-3d624d5308ae522bc421e473694172ceL3969

BackendUtility::getWorkspaceVersionOfRecord previously returned false instead of null, when a workspace record did not exist.

Reviews 1