[TYPO3-english] Flexform + DAM image

Peter Kuehn [wmdb] peter.kuehn at wmdb.de
Fri Feb 6 17:56:17 CET 2009


Hi Gregory,

im sorry: atm its not advisable to use the DAM MM-relational field 
inside of a flexform. :(

This is due to http://bugs.typo3.org/view.php?id=10165 that you can 
easily reproduce:
copy and paste some of your records. the resulting records will have 
lost their relations to DAM. Instead of the original there will be just 
one relation: to dam record with uid 1 if there were one image before, 
to uid 2 if there were two and so on.
This will happen as well if you localise or versionize a record.

The bug has a patch and is pending in the core list.

For the time being, please use a custom field with a standard array TCA 
definition.

I hope you did not spend too much time on this one
cheers
pekue

Gregory Loichot schrieb:
> Hi,
> 
> I added a flexform to my FE plugin to add a dam selector picture. The 
> selection works well (I can see thumb of selected pictures, ...), but I 
> cannot get the picture's names in the main function.
> 
> Could you help me ?
> 
> This is my flexform :
> 
> <el>
>   <wich_dam_cat>
>     <TCEforms>
>       <exclude>0</exclude>
>       <label>test</label>
>       <config type="array">
>         <form_type>user</form_type>
>         <userFunc>
> 
> <![CDATA[EXT:dam/lib/class.tx_dam_tcefunc.php:&tx_dam_tceFunc->getSingleField_typeMedia]]></userFunc> 
> 
>         <type>group</type>
>         <internal_type>db</internal_type>
>         <allowed>tx_dam</allowed>
>         <prepend_tname type="integer">1</prepend_tname>
>         <MM>tx_dam_mm_ref</MM>
>         <MM_foreign_select type="integer">1</MM_foreign_select>
>         <MM_opposite_field>file_usage</MM_opposite_field>
>         <MM_match_fields type="array">
>           <ident>field_flash</ident>
>         </MM_match_fields>
>         <allowed_types>gif,jpg,jpeg,swf</allowed_types>
>         <max_size>100000</max_size>
>         <show_thumbs type="integer">1</show_thumbs>
>         <size type="integer">1</size>
>         <maxitems type="integer">1</maxitems>
>         <minitems type="integer">0</minitems>
>         <autoSizeMax type="integer">30</autoSizeMax>
>       </config>
>     </TCEforms>
>   </wich_dam_cat>
> </el>
> 
> And in my pi1 main function :
> ....
> $this->pi_initPIflexForm();
> print_r($this->cObj->data['pi_flexform']);
> 
> ....
> 
> Print_r result :
> Array
> (
>     [data] => Array
>         (
>             [sDEF] => Array
>                 (
>                     [lDEF] => Array
>                         (
>                             [pages] => Array
>                                 (
>                                     [vDEF] => tx_dam_8
>                                 )
> 
>                             [imageMaxH] => Array
>                                 (
>                                     [vDEF] => 120
>                                 )
> 
>                             [imageMaxW] => Array
>                                 (
>                                     [vDEF] => 111
>                                 )
> 
>                             [recursive] => Array
>                                 (
>                                     [vDEF] =>
>                                 )
> 
>                             [image] => Array
>                                 (
>                                     [vDEF] => 1
>                                 )
> 
>                             [object] => Array
>                                 (
>                                     [vDEF] =>
>                                 )
> 
>                             [htmlspecialchars] => Array
>                                 (
>                                     [vDEF] => 0
>                                 )
> 
>                             [wich_dam_cat] => Array
>                                 (
>                                     [vDEF] => 1
>                                 )
> 
>                         )
> 
>                 )
> 
>             [display] => Array
>                 (
>                     [lDEF] => Array
>                         (
>                             [disable_rte] => Array
>                                 (
>                                     [vDEF] => 0
>                                 )
> 
>                         )
> 
>                 )
> 
>             [error] => Array
>                 (
>                     [lDEF] => Array
>                         (
>                             [show_errors] => Array
>                                 (
>                                     [vDEF] => 0
>                                 )
> 
>                             [prepend_text] => Array
>                                 (
>                                     [vDEF] =>
>                                 )
> 
>                         )
> 
>                 )
> 
>         )
> 
> )


More information about the TYPO3-english mailing list