Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / modules / contrib / media_entity_image / src / Plugin / EntityBrowser / Widget / Upload.php
index 90c0d40c09dfd35140a0191a29a6bfdbefaf89fe..97551b7420f455a3d26cbd37be9495250404bd86 100644 (file)
@@ -13,7 +13,8 @@ use Drupal\media_entity\MediaInterface;
  * @EntityBrowserWidget(
  *   id = "media_entity_image_upload",
  *   label = @Translation("Upload images"),
- *   description = @Translation("Upload widget that creates media entity images.")
+ *   description = @Translation("Upload widget that creates media entity images."),
+ *   auto_select = FALSE
  * )
  */
 class Upload extends FileUpload {
@@ -79,7 +80,9 @@ class Upload extends FileUpload {
       $images = $this->prepareEntities($form, $form_state);
       array_walk(
         $images,
-        function (MediaInterface $media) { $media->save(); }
+        function (MediaInterface $media) {
+          $media->save();
+        }
       );
 
       $this->selectEntities($images, $form_state);