Skip to content
This repository was archived by the owner on Aug 13, 2026. It is now read-only.
This repository was archived by the owner on Aug 13, 2026. It is now read-only.

[Bug]: Folder preview thumbnails permanently show loading spinner for newly uploaded assets Module #1105

Closed

Description

@Refaat-alktifan

Version

2.3.2 (also affects 2.2.x, 2.3.0, 2.3.1)

Description

When uploading images to an asset folder and viewing them in the Preview tab, thumbnails that haven't been generated yet show a loading spinner (video-loading.gif) that never resolves, even after the thumbnail has been generated by the messenger worker. The spinner persists until the user does a hard browser refresh (Ctrl+F5) or switches to the List view.

Root Cause

Two issues in AssetController::getImageThumbnailAction() at line 1179-1181:

1. Placeholder response is cacheable

When origin=folderPreview and the thumbnail doesn't exist yet, the controller returns video-loading.gif as a BinaryFileResponse without Cache-Control: no-store headers. The browser caches this response.

The getFolderContentPreviewAction generates thumbnail URLs using the asset's modificationDate as the _dc cache-buster parameter (e.g. _dc=1774887063). Since this timestamp never changes for the same asset, subsequent requests hit the browser cache and serve the cached spinner forever.

2. No async thumbnail generation is dispatched

For origin=treeNode, the controller dispatches AssetPreviewImageMessage to trigger async thumbnail generation. But for origin=folderPreview, no message is dispatched — the thumbnail is only generated if/when the pimcore_asset_update worker processes it independently.

Steps to Reproduce

  1. Open the Pimcore admin UI
  2. Create a new asset folder
  3. Upload 5-6 images (e.g. JPEG, 3-600KB each)
  4. Open the folder → click Preview tab
  5. Observe: some images show the loading spinner, others may show correctly (depends on timing)
  6. Wait 30+ seconds (worker generates thumbnails)
  7. Reload the page → spinners persist
  8. Switch to List view → all thumbnails display correctly

Why List view works

The List view uses a different URL pattern:

/admin/asset/get-image-thumbnail?id=1429852&treepreview=1&width=108&height=70&frame=1

The Preview (folder) view uses:

/admin/asset/get-image-thumbnail?id=1429852&treepreview=1&_dc=1774887063&origin=folderPreview

Different URL = no cached stale response in the browser.

Current code

https://github.com/pimcore/admin-ui-classic-bundle/blob/2.3/src/Controller/Admin/Asset/AssetController.php#L1169-L1183

Proposed fix

} elseif ($request->get('origin') === 'folderPreview') {
    \Pimcore::getContainer()->get('messenger.bus.pimcore-core')->dispatch(
        new AssetPreviewImageMessage($image->getId())
    );
    $response = new BinaryFileResponse(PIMCORE_WEB_ROOT . '/bundles/pimcoreadmin/img/video-loading.gif');
    $response->headers->set('Cache-Control', 'no-store, must-revalidate');
    $response->headers->set('Pragma', 'no-cache');
    $response->headers->set('Expires', '0');
    return $response;
}

Changes:

  1. Dispatch AssetPreviewImageMessage : triggers async thumbnail generation (same behavior as treeNode)
  2. Set Cache-Control: no-store : prevents the browser from caching the placeholder spinner, so the next request hits the server and gets the real thumbnail

Activity

  1. self-assigned this
    on Aug 13, 2026
  2. jcPimcore commented on Aug 13, 2026

    @jcPimcore
    Contributor

    Thanks a lot for reporting the issue. We did not consider the issue as "Pimcore:Priority", "Pimcore:ToDo" or "Pimcore:Backlog", so we're not going to work on that anytime soon. Please create a pull request to fix the issue if this is a bug report. We'll then review it as quickly as possible. If you're interested in contributing a feature, please contact us first here before creating a pull request. We'll then decide whether we'd accept it or not. Thanks for your understanding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Affected capability

None yet

Platform Version

None yet

Galaxy

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions