Skip to content
Snippets Groups Projects
Commit 6a3dbdfc authored by christian.wiedemann's avatar christian.wiedemann
Browse files

fix: File load issues

parent 0654c12d
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@ use Drupal\Core\Render\Element;
use Drupal\Core\Render\Markup;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\Url;
use Drupal\file\Entity\File;
use Drupal\layout_builder\SectionStorageInterface;
use Drupal\section_library\Entity\SectionLibraryTemplate;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
......@@ -183,7 +184,7 @@ class LayoutBuilderBrowserEventSubscriber implements EventSubscriberInterface {
// Default library image.
$img_path = $this->extensionListModule->getPath('wingsuit_lb') . '/images/section-empty-icon.svg';
if ($fid = $section->get('image')->target_id) {
$file = $this->urlGenerator->load($fid);
$file = File::load($fid);
$img_path = $file->getFileUri();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment