[BUGFIX] Forward uid to t3lib_BEfunc::getProcessedValue on creating differences
authorOliver Hader <oliver@typo3.org>
Sun, 18 Nov 2012 12:54:20 +0000 (13:54 +0100)
committerOliver Hader <oliver.hader@typo3.org>
Mon, 19 Nov 2012 07:07:17 +0000 (08:07 +0100)
The behaviour to show differences of records basically was
copied from the history service. Since the history only works
on differences/deltas and not on fully stored records, no valid
uid can be used. However in the workspaces context each side
(live version and workspace version) has a valid uid.

By forwarding this data to t3lib_BEfunc::getProcessedValue,
hooks can use this valuable information.

Change-Id: Ifa1118eb84be8269e07618c4b35437d3762534e2
Fixes: #43070
Releases: 4.5, 4.6, 4.7, 6.0
Reviewed-on: http://review.typo3.org/16549
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
typo3/sysext/workspaces/Classes/ExtDirect/ExtDirectServer.php

index c573903..b1847f0 100644 (file)
@@ -143,8 +143,24 @@ class ExtDirectServer extends \TYPO3\CMS\Workspaces\ExtDirect\AbstractHandler {
                                // call diff class only if there is a difference
                                if (strcmp($liveRecord[$fieldName], $versionRecord[$fieldName]) !== 0) {
                                        // Select the human readable values before diff
-                                       $liveRecord[$fieldName] = \TYPO3\CMS\Backend\Utility\BackendUtility::getProcessedValue($parameter->table, $fieldName, $liveRecord[$fieldName], 0, 1);
-                                       $versionRecord[$fieldName] = \TYPO3\CMS\Backend\Utility\BackendUtility::getProcessedValue($parameter->table, $fieldName, $versionRecord[$fieldName], 0, 1);
+                                       $liveRecord[$fieldName] = \TYPO3\CMS\Backend\Utility\BackendUtility::getProcessedValue(
+                                               $parameter->table,
+                                               $fieldName,
+                                               $liveRecord[$fieldName],
+                                               0,
+                                               1,
+                                               FALSE,
+                                               $liveRecord['uid']
+                                       );
+                                       $versionRecord[$fieldName] = \TYPO3\CMS\Backend\Utility\BackendUtility::getProcessedValue(
+                                               $parameter->table,
+                                               $fieldName,
+                                               $versionRecord[$fieldName],
+                                               0,
+                                               1,
+                                               FALSE,
+                                               $versionRecord['uid']
+                                       );
                                        // Get the field's label. If not available, use the field name
                                        $fieldTitle = $GLOBALS['LANG']->sL(\TYPO3\CMS\Backend\Utility\BackendUtility::getItemLabel($parameter->table, $fieldName));
                                        if (empty($fieldTitle)) {