- πΊπΈUnited States mtalt Maryland
I have run into a similar issue where default domain values are not being assigned. I am on 8.x-1.0-rc1 of the module. The settings for the entity are:
- Enable domain entity access
- Behavior is set to User
- Check any combination of default domain value(s) for the bundle
This portion of the patch in #4 fixes the issue:
function domain_entity_field_default_domains(FieldableEntityInterface $entity, FieldDefinitionInterface $definition) { - return $definition->getThirdPartySetting('domain_entity', 'domains', []); + return array_keys($definition->getThirdPartySetting('domain_entity', 'domains', [])); }
The current code results in only the first domain listed being set. This occurs because the array returned by the third party setting is keyed with strings instead of numerically. In Drupal Core's FieldInputValueNormalizerTrait::normalizeValue method, if the keys are not numeric, it will re-key all values under the 0 key. That results in only 1 of the selected default domains being set.
- π¨π³China hongqing
@mtalt do you only change the one line code? I tried it but it does not work. I granted the users the permissions to create products on assigned domains.