Commit e7b06a69 authored by git's avatar git Committed by Ismaeil Abouljamal

Issue #3072882 by MaxPah, Grimreaper, izus: Calling toArray() function on null

parent bcd5fb5b
......@@ -478,12 +478,14 @@ class FilesExtractor extends ProcessorPluginBase implements PluginFormInterface
// For each media bundle allowed, check if the source field is a
// file field.
foreach ($settings['handler_settings']['target_bundles'] as $bundle_name) {
$bundle_configuration = $this->entityTypeManager->getStorage('media_type')->load($bundle_name)->toArray();
if (isset($bundle_configuration['source_configuration']['source_field'])) {
$source_field = $bundle_configuration['source_configuration']['source_field'];
$field_config = $this->entityTypeManager->getStorage('field_storage_config')->load(sprintf('media.%s', $source_field))->toArray();
if (isset($field_config['type']) && $field_config['type'] === 'file') {
$file_elements[$property->getName()] = $property->getLabel();
if (!empty($this->entityTypeManager->getStorage('media_type')->load($bundle_name))) {
$bundle_configuration = $this->entityTypeManager->getStorage('media_type')->load($bundle_name)->toArray();
if (isset($bundle_configuration['source_configuration']['source_field'])) {
$source_field = $bundle_configuration['source_configuration']['source_field'];
$field_config = $this->entityTypeManager->getStorage('field_storage_config')->load(sprintf('media.%s', $source_field))->toArray();
if (isset($field_config['type']) && $field_config['type'] === 'file') {
$file_elements[$property->getName()] = $property->getLabel();
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment