From f445974dc502f10bf445ef0c5e9ff4f4ca7f1ad5 Mon Sep 17 00:00:00 2001 From: luisvivasb Date: Mon, 1 May 2017 01:23:49 -0400 Subject: [PATCH] Update FileUpload.php The $file->setPermanent() is already call when you use the file in media entity. If you call this function at this point you can't use tokens or filefield_paths to manipulate the image name and folder to be saved. --- .../src/Plugin/EntityBrowser/Widget/FileUpload.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/lightning_features/lightning_media/src/Plugin/EntityBrowser/Widget/FileUpload.php b/modules/lightning_features/lightning_media/src/Plugin/EntityBrowser/Widget/FileUpload.php index 7599e7c22..d3143eda8 100644 --- a/modules/lightning_features/lightning_media/src/Plugin/EntityBrowser/Widget/FileUpload.php +++ b/modules/lightning_features/lightning_media/src/Plugin/EntityBrowser/Widget/FileUpload.php @@ -104,8 +104,8 @@ public function submit(array &$element, array &$form, FormStateInterface $form_s $entity, MediaHelper::getSourceField($entity)->entity ); - $file->setPermanent(); - $file->save(); + //$file->setPermanent(); + //$file->save(); $entity->save(); $selection = [