Skip to content
Snippets Groups Projects
Commit 6fddc215 authored by Wolfgang Ziegler's avatar Wolfgang Ziegler
Browse files

Make FileReferenceFieldItemListProcessor work.

parent 591a4f0a
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@ namespace Drupal\custom_elements\Processor;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\custom_elements\CustomElement;
use Drupal\multiversion\FileItem;
use Drupal\file\Plugin\Field\FieldType\FileItem;
/**
* Renders file references (including images) into single slots.
......@@ -16,7 +16,7 @@ class FileReferenceFieldItemListProcessor implements CustomElementProcessorInter
* {@inheritdoc}
*/
public function supports($data, $viewMode) {
return $data instanceof FieldItemListInterface && $data->getFieldDefinition()->getType() == 'entity_reference' && $data->first() instanceof FileItem;
return $data instanceof FieldItemListInterface && $data->first() instanceof FileItem;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment