Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@youwe-petervanderwal
Copy link
Contributor

Changes in this pull request

Resolves #16363

Additional info

Error: Asset::create(data: ['type' => 'folder']) returned a \Pimcore\Model\Asset\Unknown instead of \Pimcore\Model\Asset\Folder
Caused by: The type was only used when detected by the binary file data
Resolved with: Adding a type check on the $data array

Side effects of bug

The bug caused other effects such as the DataHub Simple Rest API Indexer not being able to process Asset Folders created via the Classic Admin (using Asset::create) as it checked on the asset instanceof within getEntityTypeForElement ( https://github.com/pimcore/data-hub-simple-rest/blob/3.x/src/Service/AbstractService.php#L258 )

@github-actions
Copy link

github-actions bot commented May 21, 2025

Review Checklist

  • Target branch (11.5 for bug fixes, others 11.x)
  • Tests (if it's testable code, there should be a test for it - get help)
  • Docs (every functionality needs to be documented, see here)
  • Migration incl. install.sql (e.g. if the database schema changes, ...)
  • Upgrade notes (deprecations, important information, migration hints, ...)
  • Label
  • Milestone

@youwe-petervanderwal youwe-petervanderwal force-pushed the fix/16363-create-asset-of-correct-type branch from 6e2aece to 14be6d0 Compare May 21, 2025 14:54
Error: `Asset::create(data: ['type' => 'folder'])` returned a `\Pimcore\Model\Asset\Unknown` instead of `\Pimcore\Model\Asset\Folder`
Caused by: The type was only used when detected by the binary file data
Resolved with: Adding a type check on the $data array

Resolves pimcore#16363
@youwe-petervanderwal youwe-petervanderwal force-pushed the fix/16363-create-asset-of-correct-type branch from 14be6d0 to 91947f0 Compare May 21, 2025 14:59
@sonarqubecloud
Copy link

@mcop1 mcop1 self-assigned this Aug 12, 2025
@mcop1 mcop1 added the Bug label Aug 12, 2025
@mcop1 mcop1 added this to the 11.5.9 milestone Aug 12, 2025
Copy link
Contributor

@mcop1 mcop1 left a comment

Choose a reason for hiding this comment

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

Thank you, looks good to me.

@mcop1 mcop1 merged commit 366ffb4 into pimcore:11.5 Aug 12, 2025
19 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants