typo3fal

TYPO3 FAL fe_user no identifier?


This breaking change affects the fe_user table. The TYPO3 upgrade wizard reworks the table to the new FileReferences from FAL. So before all that we had the image name stored in the database, after the wizard runs we have an integer in the table.

Why does this integer get stored now? How are we supposed to get the image off the ResourceFactory without any identifier? Or am I getting it wrong? I can't work off the row's uid and also can't use the value stored in the image column.

How can I receive the image from the ResourceFactory after the upgrade wizard updated all the columns?


Solution

  • its possible to get the actual file object by the reference to the row, like this:

      $fileRepository = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Resource\FileRepository::class);
      /** @var FileReference $fileObjects */
      $fileObjects = $fileRepository->findByRelation('fe_users', 'image', $row['uid']);
    
      foreach($fileObjects as $file){
      /** @var FileReference $file */
          print_r($file->getIdentifier());
      }