BUGFIX: Support multiple dimensions and content repositories - #96
Conversation
| * @return array<string,string> | ||
| */ | ||
| protected function getDefaultDimensionConfiguration(ContentRepository $cr): array | ||
| { |
There was a problem hiding this comment.
This is super flaky and will most certainly result in hard to debug exceptions.
Neither are there single default values (multiple root values may appear as valid peers and using the first one is a dangerous simplification of this) nor is it guaranteed that the resolved coordinates are part of the allowed dimension subspace (they might not be allowed in combination)
| $targetDimensionSpacePoint = DimensionSpacePoint::fromArray([ | ||
| ...$defaultDimensionConfiguration, | ||
| $this->languageDimensionName => $target | ||
| ]); |
There was a problem hiding this comment.
I would strongly suggest another approach here:
If only the language and no other dimension value is given, I'd interpret this as "translate all variants restricted to that language".
So instead of resolving a single target, we filter the allowed dimension subspace to the DSPs with the target language and iterate over those.
| ...$defaultDimensionConfiguration, | ||
| $this->languageDimensionName => $target | ||
| ]); | ||
| } |
There was a problem hiding this comment.
same as below: I'd rather iterate over the allowed dimension subspace and resolve valid matching pairs for source and target each
With this change the CLI command can accept full DSP coordinates or merge a language value with the default configuration of the given CR.
In addition the UI plugin passes the content repository to the endpoints, so that it works for non-default CR cases.