[TYPO3-dam] Problems with dam_ttcontent diff view in workspaces and a possible solution

Francois Suter fsu-lists at cobweb.ch
Mon Feb 1 22:10:24 CET 2010


Hi all,

I recently stumbled on the following problem: let's say you have a 
content element of type Image related to 1 picture from the DAM, using 
dam_ttcontent. In a workspace, you replace the relation to that image 
with a relation to another image. The diff view tells you that the 2 
content elements are identical.

This happens because the diff viewer (the XCLASSes 
class.ux_tx_version_cm1.php and class.ux_wslib_gui.php) compare the 
values in every field. When you have a true MM relation, the field on 
which the relation is defined contains the number of relations. So if 
you just exchange one image against another, that number is still 1 and 
the workspace tool sees no difference.

Starting from there I thought about a solution. One possibility that 
came to my mind is to use t3lib_BEfunc::getProcessedValue() which turns 
relations into human-readable values. This turned out not to work, 
because it does this only for select-type and not for group-type fields.

So I copied that code and expanded on it to create a diff helper class 
for dam_ttcontent. The attached patch includes that class and shows the 
changes in the code to use.

Obviously this problem is not strictly related to the DAM, but is a 
general problem with true MM relations and workspaces. So the real 
solution is probably to improve t3lib_BEfunc::getProcessedValue() to 
work with group-type fields too, but I though I would first submit this 
idea here to collect ideas and reactions.

Note that if you want to test this patch, you will actually *not* see 
the output of my helper class in the diff view, because it is overridden 
by a hook which Ingo designed to provide a better diff view (which 
includes images). But my patch allows you to actually see that 
difference :-) .

Also, such a patch would probably only go into the next version of 
TYPO3, so it might still be useful to provide this helper class for 
older installs. Maybe in such a case, it could be tailored to work only 
with DAM records and be shipped in dam/lib.

Cheers

-- 

Francois Suter
Cobweb Development Sarl - http://www.cobweb.ch
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diffview_v1.patch
URL: <http://lists.typo3.org/pipermail/typo3-project-dam/attachments/20100201/efc068ad/attachment.txt>


More information about the TYPO3-project-dam mailing list