Projet

Général

Profil

Révision c0bac9d6

Ajouté par Assos Assos il y a presque 6 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/file_entity/file_entity.pages.inc
435 435
      // Save the file with blanks fields.
436 436
      $save = TRUE;
437 437
    }
438
    // Allow other modules to choose to skip or complete step 4.
439
    drupal_alter('file_entity_file_upload_skip_fields', $save, $form_state);
438 440
  }
439 441

  
440 442
  // Form id's can vary depending on how many other forms are displayed, so we
......
750 752
    '#title' => t('Associated with'),
751 753
    '#maxlength' => 60,
752 754
    '#autocomplete_path' => 'user/autocomplete',
753
    '#default_value' => !empty($file->uid) ? user_load($file->uid)->name : '',
755
    '#default_value' => (!empty($file->uid) && $user = user_load($file->uid)) ? $user->name : '',
754 756
    '#weight' => -1,
755 757
    '#description' => t('Leave blank for %anonymous.', array('%anonymous' => variable_get('anonymous', t('Anonymous')))),
756 758
  );
......
834 836
  // Check if a replacement file has been uploaded.
835 837
  if (!empty($form_state['values']['replace_upload'])) {
836 838
    $replacement = $form_state['values']['replace_upload'];
839
    // Existing image metadata is stored in $file->height and $file->width.
840
    // Loop through the replacement metadata and update existing values.
841
    if (!empty($replacement->metadata)) {
842
      foreach ($replacement->metadata as $metadata_key => $metadata_value) {
843
        if (isset($file->{$metadata_key})) {
844
          $file->{$metadata_key} = $metadata_value;
845
        }
846
      }
847
    }
837 848
    // Move file from temp to permanent home.
838 849
    if (!empty($form_state['values']['replace_keep_original_filename'])
839 850
    && $form_state['values']['replace_keep_original_filename']) {

Formats disponibles : Unified diff