Search code examples
typo3fluidtypo3-6.2.xfal

Fluid's image viewhelper shows outdated images


The following situation:

  • Automated importing of items:
    • Images for items are updated by some cron task perl into folder uploads/myExt/<Vendor>/<Serial>/ (Vendor and Serial may differ between products)
    • Images have naming conventions and every product has its own folder
    • A Command script is started on the command line which get's product data by an XML file; data is stored in database (Extbase tx_myext_domain_model_item)
  • Frontend Rendering
    • Extbase controller scans the the item's image folder uploads/myExt/<Vendor>/<Serial>/ and sends an array of filenames (name: imagesInFolder) in that folder along with the name of the folder (name: imageFolder) to the template
    • Fluid template loops over the imagesInFolder: <f:for each="{imagesInFolder}" as="image">
    • For every image render a thumbnail of the image with the help of Fluid's image view helper: <f:image src="{item.imageFolder -> f:format.raw()}/{image}" maxWidth="193" maxHeight="145" />

Here's the issue:

When the order of the files is changed, only the filenames are changed. but in the frontend the order remains the same as before, which is wrong. The processed thumbnails in the _processed_ folder are not updated. I have tried to change the mtime and ctime of the files to be newer than that of the processed files, but nothing has changed.

How can I tell TYPO3 to re-render processed files when original file is newer?

Maybe there is some TypoScript setting for Fluid that does this which I didn't find.
Maybe there is some Service which I could call during import?


Solution

  • There is a scheduler task named "File Abstraction Layer: Update storage index" which scans a file storage for new or changed files.

    Make sure the task starts often enough.

    In general: try to avoid replacing or renaming files as TYPO3 generates dependent files and records, which all need refreshing.

    be aware there is another similar task: "File Abstraction Layer: Extract metadata in storage", which might need to be called after the other.