Skip to content

Thumbnails: Use the same logic for list view as for the tile view#1092

Open
brusch wants to merge 3 commits into2.3from
preview-thumbnail-grid
Open

Thumbnails: Use the same logic for list view as for the tile view#1092
brusch wants to merge 3 commits into2.3from
preview-thumbnail-grid

Conversation

@brusch
Copy link
Member

@brusch brusch commented Feb 17, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 17, 2026 16:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines 107 to 110
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');

Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI commented Feb 18, 2026

@brusch I've opened a new pull request, #1093, to work on those changes. Once the pull request is ready, I'll request review from you.

* 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>
Copilot AI review requested due to automatic review settings February 18, 2026 10:25
@github-actions
Copy link

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


1 out of 2 committers have signed the CLA.
✅ (brusch)[https://github.com/brusch]
❌ @Copilot
You can retrigger this bot by commenting recheck in this Pull Request

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 18, 2026

Quality Gate Passed Quality Gate passed

Issues
0 New issues
2 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments