You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently working on overriding a Pimcore default Object Datatype (Localizedfields), as a customer of ours needs #2958 and we wanted to have it configurable (which Languages are mandatory and which are not). So I followed the instructions in the docs to override the Datatype.
Still uses the Pimcore Datatype when editing/saving ClassDefinitions in the backend.
As it looks to me, in PimcoreCoreExtension the prefixes are added as second loader to the ImplementationLoader. Since ImplementationLoader does reverse the array of loaders, it will start by using the PrefixLoader. This loads the prefixes in order. This means he will load all classes from \Pimcore\Model\DataObject\ClassDefinition\Data\ (config/default.yml) first; no matter what is defined in pimcore.objects.class_definitions.data.map.
I think this should be the other way arround, so the direkt mapping (pimcore.objects.class_definitions.data.map) is loaded before the glob mapping (pimcore.objects.class_definitions.data.prefixes). And maybe additionally reverse the prefixes, so custom configuration will be used before default (Pimcore) configuration
Steps to reproduce
(see description & expected behavior)
Current workaround
Inside my \AppBundle\DependencyInjection\AppExtensionload-Method:
Overriding data-types is not possible as it has a big potential that something massively breaks.
Best practice is to create your own data-type that extends existing data-types.
Bug Report / Discussion
I'm currently working on overriding a Pimcore default Object Datatype (Localizedfields), as a customer of ours needs #2958 and we wanted to have it configurable (which Languages are mandatory and which are not). So I followed the instructions in the docs to override the Datatype.
Expected behavior
Using either
or
results in registering/overriding the Datatype.
Actual behavior
Still uses the Pimcore Datatype when editing/saving ClassDefinitions in the backend.
As it looks to me, in PimcoreCoreExtension the prefixes are added as second loader to the ImplementationLoader. Since ImplementationLoader does reverse the array of loaders, it will start by using the PrefixLoader. This loads the prefixes in order. This means he will load all classes from
\Pimcore\Model\DataObject\ClassDefinition\Data\
(config/default.yml) first; no matter what is defined inpimcore.objects.class_definitions.data.map
.I think this should be the other way arround, so the direkt mapping (
pimcore.objects.class_definitions.data.map
) is loaded before the glob mapping (pimcore.objects.class_definitions.data.prefixes
). And maybe additionally reverse the prefixes, so custom configuration will be used before default (Pimcore) configurationSteps to reproduce
(see description & expected behavior)
Current workaround
Inside my
\AppBundle\DependencyInjection\AppExtension
load
-Method:this will override the internal PrefixLoader when Containers are merged. (Also ensuring that the container configuration is correct).
The text was updated successfully, but these errors were encountered: