[TYPO3-dam] Usage field of DAM record shows files under /uploads directory

Tobias Schmidt t.schmidt at minuskel.de
Tue Jun 26 15:58:00 CEST 2012


Hi Oliver,

disabling file upload in content elements could be an option although it 
takes away some comfort from the user. To be consequent rte magic images 
should also be disabled. Any other places where a direct upload without 
dam is possible?

A logical file and order structure is not an option for me. In my setup 
there are a dozen of independet websites from the same organisation 
inside a single TYPO3 installation. From time to time a lot of copies of 
the same image (banner) are being used. There is no chance to organize 
something like a global image repository. And after all it would be only 
a workaround as you mentioned.

Disabling uploads should be an option and not a must.

As far as I understand this issue there is no satisfying way to track 
the usage of a file. As long as files are copied to uploads/pics you 
cannot have a hash value based on file name and file path which is 
necessary for tracking a file in a specific directory. A workaround 
could be to remove the line
$rows = array_merge($rows, tx_dam_db::getMediaUsageUploads($uidList, '', 
''));
from lib/class.tx_dam_db.php to ignore copied files under uploads/pics 
completely. Is it safe to do so? Will it break something somewhere else?

How does the file abstraction layer handle copies and references of 
files? Can someone point me to a website/document with information about 
this?

Best regards
Tobias

Am 19.06.2012 21:23, schrieb Oliver Tempel:
> Hi, First of all i would disable file upload in content elements.
> Next option is a logical file and order structure so no filename came
> twice. But this is only a workaround, filepath check in combination
> with hash would be a better solution. Does it make sense that dam
> automaticly disable uploads in content elements or would be an option
> in config?
>
> Rgds Oliver
>
>
>
> Tobias Schmidt <t.schmidt at minuskel.de> schrieb:
>
>> Hi Lorenz, thank you for your answer.
>>
>> I partially disagree. In the use case that you describe (one file
>> under
>>
>> fileadmin, multiple usages in content elements) it might make
>> sense.
>>
>> But my usecase is the following: I upload a file to some directory
>> under fileadmin. The usage field of this file shows some usages
>> immediately. This happens if a copy of this file already exists
>> under uploads/pics. The files are considered to be the same because
>> the file hash of both files is the same and the file path is not
>> taken into account. There are at least two ways that let you store
>> a file under uploads/pics without a reference to a specific file
>> under fileadmin: 1) Upload a file inside a content element so there
>> is no DAM record (no
>>
>> reference at all) 2) Use the same file inside a content alement
>> from a different directory under fileadmin (a reference to another
>> DAM record)
>>
>> In my case I would consider it a bug.
>>
>> I think it needs to be discussed what should be tracked. The usage
>> of the file itself no matter where it is stored or the specific
>> file in a specific directory. I would prefer the latter.
>>
>> Best regards Tobias
>>
>> Am 16.06.2012 18:52, schrieb Lorenz Ulrich:
>>> Hi Tobias
>>>
>>> I don't know if it is intended behaviour, but I could imagine
>>> the following:
>>>
>>> When you select e.g. a picture for usage in tt_content (but
>>> without using dam_ttcontent), the file is not referenced
>>> directly, but copied
>> to
>>> uploads/pics. That could be the reason DAM is also monitoring
>>> these files to keep track of all usage... referenced or copied.
>>>
>>> Makes sense, doesn't it?
>>>
>>> Best regards,
>>>
>>> Lorenz
>>>
>>> Am 12.06.2012 11:16, schrieb Tobias Schmidt:
>>>> Hi, I'm using DAM 1.2.4 und TYPO3 4.5.16.
>>>>
>>>> I was wondering why the usage field of DAM records shows files
>>>> that
>> are
>>>> located under the /uploads directory. I came across this
>>>> strange behaviour when I uploaded a file and it immediatly
>>>> displayed a few
>> pages
>>>> where this file is being used.
>>>>
>>>> Diving into the DAM source code I finally came to the method
>>>> getMediaUsageReferences() inside lib/class.tx_dam_db.php. At
>>>> the end
>> of
>>>> this method there is the following line: $rows =
>>>> array_merge($rows, tx_dam_db::getMediaUsageUploads($uidList,
>> '',
>>>> ''));
>>>>
>>>> With the third parameter being an empty string the call to
>>>> getMediaUsageUploads() is not restricted to any directory. The
>>>> usage
>> of
>>>> files is only determined by file hash which can of course be
>>>> the
>> same
>>>> for files that belong to a DAM record and files that are
>>>> located
>> under
>>>> /uploads.
>>>>
>>>> Is this the intended behaviour? If yes what is the idea behind
>>>> it? If no is there already a bug report for this?
>>>>
>>>> Or could it be there is something wrong with my setup?
>>>>
>>>> Best regards Tobias
>>>
>>
>> _______________________________________________ TYPO3-project-dam
>> mailing list TYPO3-project-dam at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-dam
>




More information about the TYPO3-project-dam mailing list