[BUGFIX] The CE File Links (fluid_styled_content) create thumbs for non-image files 56/54856/3
authorJonathan IROULIN <joniroutypo3@gmail.com>
Wed, 29 Nov 2017 11:21:25 +0000 (12:21 +0100)
committerSusanne Moog <susanne.moog@typo3.org>
Sat, 9 Dec 2017 22:16:02 +0000 (23:16 +0100)
This patch resolves problems with usage of {file.type} to determine
if the file type is "unknown" ({file.type =} = 0)
or "text" type ({file.type =} = 1)

Resolves: #79711
Releases: master
Change-Id: I05615b7f10bc5125705e952147696d4e402dd900
Reviewed-on: https://review.typo3.org/54856
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
typo3/sysext/fluid_styled_content/Resources/Private/Templates/Uploads.html

index 8ca71c4..e780994 100644 (file)
                                                <img src="{f:uri.resource(path: 'Icons/FileIcons/{file.extension}.gif', extensionName: 'frontend')}" alt="">
                                        </f:if>
                                        <f:if condition="{data.uploads_type} == 2">
-                                               <f:if condition="{f:uri.image(src: 'file:{f:if(condition: file.originalFile, then: \'file:{file.originalFile.uid}\', else: \'file:{file.uid}\')}')} != '/'">
-                                                       <f:then>
-                                                               <a href="{file.publicUrl}" {f:if(condition:data.target,then: ' target="{data.target}"')}{f:if(condition: file.title, then: ' title="{file.title}"')}>
-                                                                       <f:media file="{file}" width="150" alt="{file.properties.alternative}" />
-                                                               </a>
-                                                       </f:then>
-                                                       <f:else>
-                                                               <img src="{f:uri.resource(path: 'Icons/FileIcons/{file.extension}.gif', extensionName: 'frontend')}" alt="">
-                                                       </f:else>
+                                               <f:if condition="{file.type} > 1">
+                                                       <f:if condition="{f:uri.image(src: 'file:{f:if(condition: file.originalFile, then: \'file:{file.originalFile.uid}\', else: \'file:{file.uid}\')}')} != '/'">
+                                                               <f:then>
+                                                                       <a href="{file.publicUrl}" {f:if(condition:data.target,then: ' target="{data.target}"')}{f:if(condition: file.title, then: ' title="{file.title}"')}>
+                                                                               <f:media file="{file}" width="150" alt="{file.properties.alternative}" />
+                                                                       </a>
+                                                               </f:then>
+                                                               <f:else>
+                                                                       <img src="{f:uri.resource(path: 'Icons/FileIcons/{file.extension}.gif', extensionName: 'frontend')}" alt="">
+                                                               </f:else>
+                                                       </f:if>
                                                </f:if>
                                        </f:if>
                                        <div>