[TYPO3-dam-devel] RFC #9113: Render new image in RTE-enabled content when the file name is changed in DAM record

Dan Osipov dosipov at phillyburbs.com
Sun Aug 10 01:09:35 CEST 2008


Ok, that did the trick.

Some notes:
* Neither the reference, nor file copy count are updated when the image 
is inserted through the RTE. I thought that was one of the features of 
this patch, no?
* Is there documentation that differentiates between the magic image and 
plain image? I see the plain image is using the url of the file 
uploaded, but the magic image is copying the file to a different 
location. What are the benefits of using one vs the other?
* Reading through the patch, it doesn't look like it touches the "Drag 
'n' Drop" tab functionality. That tab doesn't really work for me. Should 
it be removed? Should that functionality be added to "Magic Image" tab, 
to make it really magic?
* Should the "Enable the DAM media browser [enableDAMBrowser]" constant 
be removed from RTE set up, since it renders this functionality useless?
* Assuming this patch is applied before 1.1 is released, would Typo3 
4.2.2 be a requirement for DAM 1.1?

Other than that, great work! +1 from me.

Dan Osipov
Calkins Media
http://danosipov.com/blog/

Stanislas Rolland wrote:
> Hi Dan,
> 
> If you installed the latest TYPO3 4.2.2-dev and DAM 1.1.0-dev and you 
> applied the patch for #9113, then:
> 
> 1. uncheck the use of DAM in the EM settings of the RTE;
> 2. check RTE integration in the EM settings of DAM;
> 3. clear the TYPO3 configuration cache;
> 4. delete all files in typo3temp/rtehtmlarea;
> 5. clear the browser cache.
> 
> Thank you for testing this patch,
> Stanislas
> 
> P.S. You do not need to apply patch #8673, as it has already been 
> committed to DAM (revision 9502) and tested with SVN TYPO3_4.2 (revision 
> 3898).
> 
> 
> Dan Osipov a écrit :
>> Stanislas,
>>
>> I tried to apply your patch to a fresh install of Typo3 4.2.2-dev and 
>> DAM 1.1.0-dev from SVN.
>> I enabled the use of DAM in the RTE settings.
>> While creating a text element and attempting to add an image I was 
>> greeted with the following error:
>> Fatal error: Call to a member function getContextMenuCode() on a 
>> non-object in 
>> /srv/www/htdocs/t34-22/typo3conf/ext/dam/class.tx_dam_browse_media.php 
>> on line 139
>>
>> After applying the patch, the error persisted.
>> Ideas?
>>
>> Thanks for your work!
>> Dan Osipov
>> Calkins Media
>> http://danosipov.com/blog/
>>
>> Stanislas Rolland wrote:
>>> Hi all,
>>>
>>> This is a SVN patch request for the DAM project.
>>>
>>> Type: Feature
>>>
>>> Problem:
>>> If an image was inserted in a RTE-enabled field of tt_content and the 
>>> file name is updated in the DAM record, the new file or renamed file 
>>> should be rendered in the frontend.
>>>
>>> Solution:
>>> The attached patch adds a preprocessing function of the img tag to 
>>> the frontend parsing of RTE-enabled content. The function looks for 
>>> custom attribute txdam. As a side-result of a previous patch, the 
>>> value of the attribute is set to the value of the DAM media id when 
>>> the image is inserted in the RTE-enabled field. If the current file 
>>> name found in the DAM record is different from the one that was 
>>> inserted in the RTE content, the src attribute of the img tag is 
>>> updated. If the image was a magic image, a new reference and magic 
>>> images are created (if no such files exist with the same file name, 
>>> media id, and magic width and height). The custom attribute is then 
>>> unset so that it does not show up in the frontend html. The page 
>>> content cache must be cleared for the new image to be rendered.
>>>
>>> Notes:
>>> 1. Thanks to alterNet for sponsoring this work.
>>> 2. This patch requires current SVN TYPO3core branch TYPO3_4-2 (TYPO3 
>>> 4.2.2-dev).
>>> 3. Tested with current SVN TYPO3core branches TYPO3_4-2 and trunk.
>>>
>>> Bugtracker references:
>>> http://bugs.typo3.org/view.php?id=9113
>>>
>>> Branches:
>>> trunk
>>>
>>> Kind regards,
>>> Stanislas
>>>
> 


More information about the TYPO3-team-dam mailing list