Update to Drupal 8.2.0. For more information, see https://www.drupal.org/project/drupal/releases/8.2.0
This commit is contained in:
parent
2f563ab520
commit
f1c8716f57
1732 changed files with 52334 additions and 11780 deletions
|
|
@ -37,7 +37,7 @@ function file_help($route_name, RouteMatchInterface $route_match) {
|
|||
$output .= '<dd>' . t('The <em>settings</em> and the <em>display</em> of the file field can be configured separately. See the <a href=":field_ui">Field UI help</a> for more information on how to manage fields and their display.', array(':field_ui' => (\Drupal::moduleHandler()->moduleExists('field_ui')) ? \Drupal::url('help.page', array('name' => 'field_ui')) : '#')) . '</dd>';
|
||||
$output .= '<dt>' . t('Allowing file extensions') . '</dt>';
|
||||
$output .= '<dd>' . t('In the field settings, you can define the allowed file extensions (for example <em>pdf docx psd</em>) for the files that will be uploaded with the file field.') . '</dd>';
|
||||
$output .= '<dt>' . t('Storing files ') . '</dt>';
|
||||
$output .= '<dt>' . t('Storing files') . '</dt>';
|
||||
$output .= '<dd>' . t('Uploaded files can either be stored as <em>public</em> or <em>private</em>, depending on the <a href=":file-system">File system settings</a>. For more information, see the <a href=":system-help">System module help page</a>.', array(':file-system' => \Drupal::url('system.file_system_settings'), ':system-help' => \Drupal::url('help.page', array('name' => 'system')))) . '</dd>';
|
||||
$output .= '<dt>' . t('Restricting the maximum file size') . '</dt>';
|
||||
$output .= '<dd>' . t('The maximum file size that users can upload is limited by PHP settings of the server, but you can restrict by entering the desired value as the <em>Maximum upload size</em> setting. The maximum file size is automatically displayed to users in the help text of the file field.') . '</dd>';
|
||||
|
|
@ -442,8 +442,16 @@ function file_validate_image_resolution(FileInterface $file, $maximum_dimensions
|
|||
// Try to resize the image to fit the dimensions.
|
||||
if ($image->scale($width, $height)) {
|
||||
$image->save();
|
||||
$file->filesize = $image->getFileSize();
|
||||
drupal_set_message(t('The image was resized to fit within the maximum allowed dimensions of %dimensions pixels.', array('%dimensions' => $maximum_dimensions)));
|
||||
if (!empty($width) && !empty($height)) {
|
||||
$message = t('The image was resized to fit within the maximum allowed dimensions of %dimensions pixels.', array('%dimensions' => $maximum_dimensions));
|
||||
}
|
||||
elseif (empty($width)) {
|
||||
$message = t('The image was resized to fit within the maximum allowed height of %height pixels.', array('%height' => $height));
|
||||
}
|
||||
elseif (empty($height)) {
|
||||
$message = t('The image was resized to fit within the maximum allowed width of %width pixels.', array('%width' => $width));
|
||||
}
|
||||
drupal_set_message($message);
|
||||
}
|
||||
else {
|
||||
$errors[] = t('The image exceeds the maximum allowed dimensions and an attempt to resize it failed.');
|
||||
|
|
@ -1310,7 +1318,7 @@ function file_icon_class($mime_type) {
|
|||
* @param string $mime_type
|
||||
* A MIME type.
|
||||
*
|
||||
* @return string|FALSE
|
||||
* @return string|false
|
||||
* The generic icon MIME package expected for this file.
|
||||
*/
|
||||
function file_icon_map($mime_type) {
|
||||
|
|
@ -1474,7 +1482,8 @@ function file_get_file_references(FileInterface $file, FieldDefinitionInterface
|
|||
$usage_list = \Drupal::service('file.usage')->listUsage($file);
|
||||
$file_usage_list = isset($usage_list['file']) ? $usage_list['file'] : array();
|
||||
foreach ($file_usage_list as $entity_type_id => $entity_ids) {
|
||||
$entities = entity_load_multiple($entity_type_id, array_keys($entity_ids));
|
||||
$entities = \Drupal::entityTypeManager()
|
||||
->getStorage($entity_type_id)->loadMultiple(array_keys($entity_ids));
|
||||
foreach ($entities as $entity) {
|
||||
$bundle = $entity->bundle();
|
||||
// We need to find file fields for this entity type and bundle.
|
||||
|
|
|
|||
Reference in a new issue