Task #43916
closedEpic #58282: Workspaces Workpackage #2
Story #58284: Bug fixes & Behaviour
File Repository does not work with Workspaces
100%
Description
The FileRepository \TYPO3\CMS\Core\Resource\FileRepository does not support versioning/workspaces. The bug is in the function "findByRelation".
The patch in attachment work for me.
Files
Updated by Reindl Bernd almost 12 years ago
Hello,
i have the same problem with TYPO3 6.0.3.
With this patch the relations for the workspace are found.
But if i create a relation in the workspace, the relation is lost. So i have extend the function.
@
public function findByRelation($tableName, $fieldName, $uid) {
$itemList = array();
if (!\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($uid)) {
throw new \InvalidArgumentException('Uid of related record has to be an integer.', 1316789798);
}
$considerWorkspaces = !empty($GLOBALS['BE_USER']->workspace) && \TYPO3\CMS\Backend\Utility\BackendUtility::isTableWorkspaceEnabled($tableName) ? 1 : 0;
if($considerWorkspaces)
{
$row = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
'*',
$tableName,
'uid=' . intval($uid)
);
$row = $row[0];
\TYPO3\CMS\Backend\Utility\BackendUtility::workspaceOL($tableName, $row);
if(isset($row['_ORIG_uid']))
$uid = $row['_ORIG_uid'];
}
$references = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
'*',
'sys_file_reference',
'tablenames=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($tableName, 'sys_file_reference') .
' AND deleted = 0' .
' AND hidden = 0' .
' AND uid_foreign=' . intval($uid) .
' AND fieldname=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($fieldName, 'sys_file_reference'),
'',
'sorting_foreign'
);
foreach ($references as $referenceRecord) {
if($referenceRecord['t3ver_state'] > 0)
{
continue;
}
if ($considerWorkspaces)
{
\TYPO3\CMS\Backend\Utility\BackendUtility::workspaceOL('sys_file_reference', $referenceRecord);
}
$itemList[] = $this->createFileReferenceObject($referenceRecord);
}
return $itemList;
}@
This works fine for me.
Updated by Marius S. almost 12 years ago
Reindl Bernd's version works great for me! Thank you.
Please have this one released.
Updated by Gabe Blair about 11 years ago
@Reindl Bernd: Thanks for the patch. Will you be submitting a Gerrit change for it? You will have a much better chance of getting it into the official core that way.
Updated by Alexander Opitz almost 11 years ago
- Project changed from 1401 to TYPO3 Core
- Category changed from Frontend to Frontend
Updated by Alexander Opitz almost 11 years ago
- Category changed from Frontend to File Abstraction Layer (FAL)
- Is Regression set to No
- TYPO3 Version set to 6.0
Updated by Alex Pöll over 10 years ago
Dear TYOP3 core team,
we're using TYPO3 6.1.7 and have experienced this problem. (Images of not yet published content don't show up in Preview).
Although we've implemented the above patch it's still not working.
I'd appreciate if you could help!
Are you going to fix this bug for TYPO3 6.1.7?
And is the same bug present in the new TYPO3 6.2 LTS Version?
Kind regards,
Alex
Updated by Markus Timtner over 10 years ago
Hi Alex,
this issue has forced me to do the update to v6.2LTS - and I am not looking back since ;)
The FAL implementation is now fully Workspace compatible, along with other significant UI improvements.
Kind regards,
MT
Updated by Alex Pöll over 10 years ago
Thanks a lot Markus for your fast response. Sounds good!
Updated by Benni Mack over 10 years ago
Hey,
well, files might work, but file relations won't work with repositories at all anymore.
Change an image relation to tt_content (sys_file_reference) in a workspace and publish that - the live workspace will show two records.
Updated by Gerrit Code Review over 10 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29712
Updated by Gerrit Code Review over 10 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29712
Updated by Gerrit Code Review over 10 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29712
Updated by Gerrit Code Review over 10 years ago
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/30100
Updated by Gerrit Code Review over 10 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29712
Updated by Gerrit Code Review over 10 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29712
Updated by Gerrit Code Review over 10 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29712
Updated by Gerrit Code Review over 10 years ago
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29712
Updated by Gerrit Code Review over 10 years ago
Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29712
Updated by Benni Mack over 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset ed5b0d124dcc7b8975e37b9afda6fae18c8aff6e.
Updated by Alex Pöll over 10 years ago
- File Screen_Shot_2014-07-10_at_16.31.46.png Screen_Shot_2014-07-10_at_16.31.46.png added
- File Screen_Shot_2014-07-10_at_16.35.28.png Screen_Shot_2014-07-10_at_16.35.28.png added
- File Screen_Shot_2014-07-10_at_16.34.39.png Screen_Shot_2014-07-10_at_16.34.39.png added
- File Screen_Shot_2014-07-10_at_16.38.40.png Screen_Shot_2014-07-10_at_16.38.40.png added
Dear TYOP3 core team,
we've recently updated (from 6.1.7) to TYPO3 6.2.3 in order to have this problem solved. Unfortunately a new problem come up:
Images of not yet published content (workspaces mode) now appear twice in the backend layout of the page and in the website preview. Please have a look at the attached screenshots.
Thanks for your support,
Alex
Updated by Gerhard Rupp over 10 years ago
It seems that this is fixed in TYPO3 6.2.4.