Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / locale / src / Form / ImportForm.php
index 40a77204b47d373a52819a816429b8d55ee64840..a9f15f07f18de6160e565e500965bfcf795cf126 100644 (file)
@@ -11,6 +11,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
  * Form constructor for the translation import screen.
+ *
+ * @internal
  */
 class ImportForm extends FormBase {
 
@@ -108,6 +110,7 @@ class ImportForm extends FormBase {
       ],
       '#size' => 50,
       '#upload_validators' => $validators,
+      '#upload_location' => 'translations://',
       '#attributes' => ['class' => ['file-import-input']],
     ];
     $form['langcode'] = [
@@ -154,7 +157,7 @@ class ImportForm extends FormBase {
    * {@inheritdoc}
    */
   public function validateForm(array &$form, FormStateInterface $form_state) {
-    $this->file = file_save_upload('file', $form['file']['#upload_validators'], 'translations://', 0);
+    $this->file = _file_save_upload_from_form($form['file'], $form_state, 0);
 
     // Ensure we have the file uploaded.
     if (!$this->file) {