Thumbnails: Use the same logic for list view as for the tile view#1092
Thumbnails: Use the same logic for list view as for the tile view#1092
Conversation
There was a problem hiding this comment.
Pull request overview
Updates admin grid thumbnail URL generation to use Symfony route names (matching the tile view approach) instead of hardcoded /admin/asset/get-*-thumbnail paths.
Changes:
- Replace manually constructed thumbnail URLs with router-generated URLs for asset thumbnails.
- Add route selection logic per asset subtype (image/video/document/folder).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/Service/GridData/Asset.php
Outdated
| if (!empty($thumbnailMethod)) { | ||
| $thumbnailUrl = '/admin/asset/get-' . $asset->getType() . '-thumbnail?id=' . $asset->getId(); | ||
| if (count($params) > 0) { | ||
| $thumbnailUrl .= '&' . http_build_query($params); | ||
| // Get URL generator from service container | ||
| $urlGenerator = \Pimcore::getContainer()->get('router'); | ||
|
|
There was a problem hiding this comment.
The folder thumbnail branch is currently unreachable: the URL generation is wrapped in if (!empty($thumbnailMethod)), but $thumbnailMethod is never set for Model\Asset\Folder. If folders are intended to have thumbnails here, either set $thumbnailMethod for folders or remove the guard and choose the route purely based on the asset instance (as done in ElementService::getThumbnailUrl).
* Initial plan * Delegate thumbnail URL generation to ElementService Co-authored-by: brusch <142037+brusch@users.noreply.github.com> * Add origin=folderPreview parameter to align with folder preview thumbnails Co-authored-by: brusch <142037+brusch@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: brusch <142037+brusch@users.noreply.github.com>
|
CLA Assistant Lite bot: I have read the CLA Document and I hereby sign the CLA 1 out of 2 committers have signed the CLA. |
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

No description provided.