Skip to content

Commit

Permalink
Fix call to deprecated function file_upload_max_size().
Browse files Browse the repository at this point in the history
Use \Drupal\Component\Utility\Environment::getUploadMaxSize() instead.
  • Loading branch information
leymannx committed Oct 8, 2019
1 parent f150cb9 commit 2e417e2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Form/CSVimportForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Drupal\csvimport\Form;

use Drupal\Component\Utility\Environment;
use Drupal\Core\File\FileSystemInterface;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
Expand Down Expand Up @@ -33,7 +34,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
$form['csvfile'] = [
'#title' => $this->t('CSV File'),
'#type' => 'file',
'#description' => ($max_size = file_upload_max_size()) ? $this->t('Due to server restrictions, the <strong>maximum upload file size is @max_size</strong>. Files that exceed this size will be disregarded.', ['@max_size' => format_size($max_size)]) : '',
'#description' => ($max_size = Environment::getUploadMaxSize()) ? $this->t('Due to server restrictions, the <strong>maximum upload file size is @max_size</strong>. Files that exceed this size will be disregarded.', ['@max_size' => format_size($max_size)]) : '',
'#element_validate' => ['::validateFileupload'],
];

Expand Down

0 comments on commit 2e417e2

Please sign in to comment.