Skip to content
Snippets Groups Projects
Commit 84a99b30 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2571943 by pwolanin, nevergone: Remove !placeholder in file.module

parent beed345b
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -1182,7 +1182,7 @@ function file_managed_file_save_upload($element, FormStateInterface $form_state)
if ($files_uploaded) {
if (!$files = file_save_upload($upload_name, $element['#upload_validators'], $destination)) {
\Drupal::logger('file')->notice('The file upload failed. %upload', array('%upload' => $upload_name));
$form_state->setError($element, t('Files in the !name field were unable to be uploaded.', array('!name' => $element['#title'])));
$form_state->setError($element, t('Files in the @name field were unable to be uploaded.', array('@name' => $element['#title'])));
return array();
}
......
......@@ -24,7 +24,7 @@ function file_field_views_data(FieldStorageConfigInterface $field_storage) {
'base' => 'file_managed',
'entity type' => 'file',
'base field' => 'fid',
'label' => t('file from !field_name', array('!field_name' => $field_storage->getName())),
'label' => t('file from @field_name', array('@field_name' => $field_storage->getName())),
);
}
......
......@@ -249,7 +249,7 @@ public static function validateExtensions($element, FormStateInterface $form_sta
*/
public static function validateMaxFilesize($element, FormStateInterface $form_state) {
if (!empty($element['#value']) && !is_numeric(Bytes::toInt($element['#value']))) {
$form_state->setError($element, t('The "!name" option must contain a valid value. You may either leave the text field empty or enter a string like "512" (bytes), "80 KB" (kilobytes) or "50 MB" (megabytes).', array('!name' => t($element['title']))));
$form_state->setError($element, t('The "@name" option must contain a valid value. You may either leave the text field empty or enter a string like "512" (bytes), "80 KB" (kilobytes) or "50 MB" (megabytes).', array('@name' => $element['title'])));
}
}
......
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