[TASK] Follow-up only display active Avatar files
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Classes / Backend / Avatar / Avatar.php
index fd3055a..fe94c9a 100644 (file)
@@ -14,6 +14,7 @@ namespace TYPO3\CMS\Backend\Backend\Avatar;
  * The TYPO3 project - inspiring people to share!
  */
 
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Resource\ResourceFactory;
 use TYPO3\CMS\Core\Resource\Exception\FileDoesNotExistException;
 use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Resource\ResourceFactory;
 use TYPO3\CMS\Core\Resource\Exception\FileDoesNotExistException;
@@ -82,7 +83,8 @@ class Avatar {
                        'uid_local',
                        'sys_file_reference',
                        'tablenames = \'be_users\' AND fieldname = \'avatar\' AND ' .
                        'uid_local',
                        'sys_file_reference',
                        'tablenames = \'be_users\' AND fieldname = \'avatar\' AND ' .
-                       'table_local = \'sys_file\' AND uid_foreign = ' . (int)$beUserId
+                       'table_local = \'sys_file\' AND uid_foreign = ' . (int)$beUserId .
+                       BackendUtility::BEenableFields('sys_file_reference') . BackendUtility::deleteClause('sys_file_reference')
                );
                return $file ? $file['uid_local'] : 0;
        }
                );
                return $file ? $file['uid_local'] : 0;
        }