Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Attribute caching is not class-scoped, allowing stale advanced fields after changing the resolver class.
Review effort: Balanced
Findings: 1
What changed in this PR
Enables advanced many-to-many relation fields as Studio mapping targets.
Changes:
- Adds target-aware attribute-map keys and request parsing.
- Fetches advanced relation attributes when required.
- Excludes advanced-only keys from direct-mapping autofill.
| File | Description |
|---|---|
types.ts |
Adds advanced attribute-key helpers. |
compute-autofill-suggestions.ts |
Excludes advanced relation entries. |
mapping-item.tsx |
Resolves attributes using target type. |
mapping-item-with-filter.tsx |
Passes target type to mapping items. |
use-mapping-step-loader.types.ts |
Renames the watched-key result. |
use-mapping-step-loader.tsx |
Loads attributes using parsed map keys. |
useClassAttributes.ts |
Selects target-specific attributes. |
use-auto-recalculate-type.ts |
Fetches advanced attributes on demand. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
… data target The class attributes were only keyed by transformation result type and always requested without loadAdvancedRelations, so advancedManyToMany(Object)Relation fields never showed up in the target field select, whichever data target was chosen. Attributes for the manyToManyRelation data target are now kept under a separate map key and requested with loadAdvancedRelations=true. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The class can be changed in the resolver step without saving. The mapping step loader only fetched the attribute map keys that were missing, so entries loaded for the previous class, e.g. its advanced relation fields, stayed in use. The loader now tracks which class the map belongs to and reloads every needed key when it changes, discarding results of a superseded class. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
f1b1272 to
e69c768
Compare
|
I have read the CLA Document and I hereby sign the CLA 13 out of 14 committers have signed the CLA. |
|
🚫 CI & merge-readiness guardrail failed — this PR has been converted to draft. A PR can only be merged when it has no conflicts with the base branch and all CI checks pass.
When fixed, press Ready for review to re-run the checks. |
|
|
Hello @alexbaat Thanks for your contribution! Since 2026.3 is released we do not maintain any 2026.2 version line anymore. There is no todo coming with this on your side. Just an information. Kind regards, Jochen |




Bug
In the Studio Data Importer, fields of type Advanced Many-to-Many Relation and Advanced Many-to-Many Object Relation can never be selected as a mapping target. With a transformation result of
dataObjectArray/assetArraythe field select only lists the plain many-to-many fields — also when the data target type is Many-to-Many Relation, the one data target that writes advanced relations (ManyToManyRelation::getMergedDataArray()wraps the elements inObjectMetadata/ElementMetadata).Steps to reproduce
dataObjectArray(e.g. Load Data Object → As Array).Cause
The backend supports it already:
GET /data-importer/data-type/class-attributesacceptsloadAdvancedRelations, andTransformationDataTypeService::getPimcoreDataTypes()then replacesdataObjectArray/assetArraywithadvancedDataObjectArray/advancedAssetArray, which include the advanced relation types. The Studio UI never sends the flag, and it keeps the loaded class attributes in a map keyed only by transformation result type, so the data target type never influences which fields are offered.Fix
The attributes map key now also depends on the data target type:
resolveAttrMapKey(transformationResultType, dataTargetType?)returnsadvancedRelations:<result type>for themanyToManyRelationdata target with adataObjectArray/assetArrayresult; every other combination keeps its existing key.parseAttrMapKey()turns a key back into the request parameters (transformationResultType+loadAdvancedRelations), so the mapping step loader and the modal's on-demand fetch (useAutoRecalculateType) request exactly what the key stands for.useClassAttributes(field select in the modal),MappingItem(collapsed row title, now also part of the memo comparison) and the loader's watched key list, so switching a saved mapping's data target fetches the missing list.directmappings, which cannot write advanced relations.The
directdata target keeps offering the plain relation fields only, which is correct —Directpasses the raw elements to the setter, which an advanced relation does not accept.Notes
assets/studiohas no jest/vitest setup, so there is no automated test to add;tsc --noEmitand ESLint pass. The built assets undersrc/Resources/public/studio/build/are left to the automatic frontend build (thecommit-buildjob is skipped for fork PRs).loadAdvancedRelations=true.new ObjectMetadata($this->fieldName, [], $dataObject)); importing metadata values is out of scope here.Tracking issue
Fixes pimcore/platform-version#536
🤖 Generated with Claude Code