- 🇦🇺Australia imclean Tasmania
#76:
+++ b/core/modules/file/file.module @@ -1435,7 +1435,7 @@ function file_managed_file_save_upload($element, FormStateInterface $form_state) - \Drupal::logger('file')->notice('The upload directory %directory for the file field %name could not be created or is not accessible. A newly uploaded file could not be saved in this directory as a consequence, and the upload was canceled.', ['%directory' => $destination, '%name' => $element['#field_name']]); + \Drupal::logger('file')->notice('TThe upload directory %directory for the %name field could not be created or is not accessible, so the uploaded file was not saved.', ['%directory' => $destination, '%name' => $element['#field_name']]);
From the issue summary:
The problem being that on non-entity forms #field_name is not set
This issue is about removing the reliance on
$element['#field_name']
being set.Another way this problem shows itself is if the %name parameter is NULL when file.module logs an error, then the dblog page displays a white screen with the text "The website encountered an unexpected error. Try again later." The only way to fix this is to delete the entry in the watchdog table.