Hi! TY for the module.
I'm get error.
LogicException: Getting the base fields is not supported for entity type Block. in Drupal\Core\Entity\EntityFieldManager->buildBaseFieldDefinitions() (line 201 of /var/www/html/web/core/lib/Drupal/Core/Entity/EntityFieldManager.php).
I'm change|correction function paragraphs_clean_entity_presave
function paragraphs_clean_entity_presave(EntityInterface $entity) {
/** @var \Drupal\Core\Entity\EntityFieldManager $fieldManager */
$fieldManager = \Drupal::service('entity_field.manager');
$parentEntities = $fieldManager->getFieldMapByFieldType('entity_reference_revisions');
if (!array_key_exists($entity->getEntityTypeId(), $parentEntities)) {
return;
}
$field_definitions = [];
foreach ($parentEntities[$entity->getEntityTypeId()] as $field_id => $settings) {
$field_definitions[] = FieldConfig::loadByName($entity->getEntityTypeId(), $entity->bundle(), $field_id);
}
if (empty($field_definitions)){
return;
}
foreach ($field_definitions as $field_definition) {
if ($field_definition->getSetting('target_type') == 'paragraph') {
And created patch.
Comments
Comment #2
batkorAdd import class for FieldConfig
Comment #3
andypostComment #4
aaronbaumanPlease update to latest 1.x-dev version - patch does not apply
Let me know if that fixes it.
If so I'll push a new release.
Someone else ran into a similar issue.
Comment #5
batkorHi!
I'm correction patch for dev version, add check origin object and check load fieldConfig.
Comment #6
batkorComment #7
krzysztof domańskiSmall correction (coding standard).
Comment #8
aaronbaumanThe additional check to make sure the field(s) exist is good, but I think we should keep the FieldableEntityInterface check as well.
Is there any good reason to remove this?
Comment #9
krzysztof domańskiI agree that we should leave this condition. But, let's change the comment.
Comment #10
aaronbaumanLooks good to me.
I will test it tomorrow to make sure.
Comment #12
aaronbaumanCommitted, thank you for your work!