Commit 6f3aa2de authored by Sascha Grossenbacher's avatar Sascha Grossenbacher Committed by Sascha Grossenbacher
Browse files

Issue #3287561 by Berdir, Project Update Bot, dpi: Automated Drupal 10 compatibility fixes

parent 4c563667
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -3,6 +3,13 @@
  "description": "Extends Drupal file entities to be fieldable and viewable.",
  "type": "drupal-module",
  "license": "GPL-2.0+",
  "minimum-stability": "dev",
  "require": { }
  "require": {
    "drupal/core": "^9.3 || ^10",
    "drupal/token": "^1",
    "php": ">=8.0"
  },
  "require-dev": {
    "drupal/pathauto": "^1",
    "drupal/hal": " ^9 || ^1 || ^2"
  }
}
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ function hook_file_download_headers_alter(array &$headers, $file) {
function hook_file_transfer($uri, array $headers) {
  // Redirect a download for an S3 file to the actual location.
  if (StreamWrapperManager::getScheme($uri) == 's3') {
    $url = file_create_url($uri);
    $url = \Drupal::service('file_url_generator')->generateAbsoluteString($uri);
    drupal_goto($url);
  }
}
+2 −3
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@ type: module
name: File entity
description: "Extends Drupal file entities to be fieldable and viewable."
package: Media
core_version_requirement: ^8.8 || ^9
core_version_requirement: ^9.3 || ^10
dependencies:
  - drupal:file
  - drupal:text
@@ -10,5 +10,4 @@ dependencies:
  - drupal:image
  - token:token
configure: file_entity.settings
test_dependencies:
  - pathauto:pathauto
php: 8.0
+1 −0
Original line number Diff line number Diff line
@@ -78,6 +78,7 @@ function file_entity_install() {
  // Queue all files to be classified during cron runs using the Queue API.
  $queue = \Drupal::queue('file_entity_type_determine');
  $ids = \Drupal::entityQuery('file')
    ->accessCheck(FALSE)
    ->execute();
  foreach ($ids as $id) {
    $queue->createItem($id);
+3 −2
Original line number Diff line number Diff line
<?php

use Drupal\Core\Render\Element;
/**
 * @file
 * Extends Drupal file entities to be fieldable and viewable.
@@ -248,7 +249,7 @@ function template_preprocess_file(&$variables) {

  // Helpful $content variable for templates.
  $variables += array('content' => array());
  foreach (\Drupal\Core\Render\Element::children($variables['elements']) as $key) {
  foreach (Element::children($variables['elements']) as $key) {
    $variables['content'][$key] = $variables['elements'][$key];
  }

@@ -480,7 +481,7 @@ function file_uri_to_object($uri, $use_existing = TRUE) {
    $file = File::create(array(
      'uid' => \Drupal::currentUser()->id(),
      'uri' => $uri,
      'status' => FILE_STATUS_PERMANENT,
      'status' => FileInterface::STATUS_PERMANENT,
    ));
  }

Loading