Projet

Général

Profil

Révision 02a0babc

Ajouté par Assos Assos il y a presque 7 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/file_entity/file_entity.module
1141 1141
      'label' => t('Image'),
1142 1142
      'default settings' => array(
1143 1143
        'image_style' => '',
1144
        'alt' => '[file:field_file_image_alt_text]',
1145
        'title' => '[file:field_file_image_title_text]'
1144
        'alt' => '[file:field-file-image-alt-text]',
1145
        'title' => '[file:field-file-image-title-text]'
1146 1146
      ),
1147 1147
      'view callback' => 'file_entity_file_formatter_file_image_view',
1148 1148
      'settings callback' => 'file_entity_file_formatter_file_image_settings',
......
1677 1677

  
1678 1678
  // $file may be either an object or a file type. Since file types cannot be
1679 1679
  // an integer, use either fid or type as the static cache id.
1680
  $cache_id = is_object($file) ? $file->fid : $file;
1680
  $cache_id = NULL;
1681
  if (!empty($file->id)) {
1682
    $cache_id = $file->id;
1683
  }
1684
  elseif (is_string($file) && $op == 'create') {
1685
    $cache_id = $file;
1686
  }
1687
  else {
1688
    $cache_id = drupal_hash_base64(serialize($file));
1689
  }
1681 1690

  
1682 1691
  // If we've already checked access for this file, user and op, return from
1683 1692
  // cache.
......
1738 1747
 */
1739 1748
function file_entity_file_entity_access($op, $file, $account) {
1740 1749
  // If the file URI is invalid, deny access.
1741
  if (is_object($file) && !file_valid_uri($file->uri)) {
1750
  if (is_object($file) && isset($file->uri) && !file_valid_uri($file->uri)) {
1751
    if(isset($file->is_new) && $file->is_new == true && user_access('create files')) {
1752
      return FILE_ENTITY_ACCESS_ALLOW;
1753
    }
1742 1754
    return FILE_ENTITY_ACCESS_DENY;
1743 1755
  }
1744 1756

  
......
1832 1844
  if (!$base_table) {
1833 1845
    $fallback = '';
1834 1846
    foreach ($tables as $alias => $table_info) {
1835
      if (!($table_info instanceof SelectQueryInterface)) {
1847
      if (!($table_info instanceof SelectQueryInterface || $table_info['table'] instanceof SelectQueryInterface)) {
1836 1848
        $table = $table_info['table'];
1837 1849
        // If the file_managed table is in the query, it wins immediately.
1838 1850
        if ($table == 'file_managed') {

Formats disponibles : Unified diff