Skip to content
Snippets Groups Projects

3494126 - Moved the file_get_content_headers() to File Entity

Closes #3494126

Merge request reports

Members who can merge are allowed to add commits.
Code Quality is loading
Test summary results are being parsed
Ready to merge by members who can write to the target branch.
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • added 1 commit

    • 9cb1b395 - 3494126 - Replaced the file_get_content_headers with Entity method

    Compare with previous version

  • added 1 commit

    • 9b632d7b - 3494126 - Added the Deprecation message

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • Kim Pepper
  • Looking good.

    There are no existing tests that are triggering that deprecation, so we will need to add one.

  • added 1 commit

    • 3068a264 - 3494126 - Updates to deprecation messages

    Compare with previous version

  • Kim Pepper resolved all threads

    resolved all threads

  • 300 300 Cache::invalidateTags($tags);
    301 301 }
    302 302
    303 /**
    304 * Examines a file entity and returns content headers for download.
    305 *
    306 * @return array
    307 * An associative array of headers, as expected by
    308 * \Symfony\Component\HttpFoundation\StreamedResponse.
    309 */
    310 public function getFileContentHeaders() {
  • added 1 commit

    • 360db133 - 3494126 - changed method to getDownloadHeaders()

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • 34 34 * @return array
    35 35 * An associative array of headers, as expected by
    36 36 * \Symfony\Component\HttpFoundation\StreamedResponse.
    37 *
    38 * @deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. Instead, use $file->getDownloadHeaders().
    39 * @see https://www.drupal.org/node/3494172
    37 40 */
    38 41 function file_get_content_headers(FileInterface $file) {
    42 @trigger_error(__METHOD__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. Instead, use $file->getDownloadHeaders(). See https://www.drupal.org/node/3494172', E_USER_DEPRECATED);
    39 43 return [
    40 44 'Content-Type' => $file->getMimeType(),
    41 45 'Content-Length' => $file->getSize(),
    42 46 'Cache-Control' => 'private',
    43 47 ];
  • added 1 commit

    • d2746bb3 - 3494126 - Updated deprecation message

    Compare with previous version

  • added 1 commit

    • b2463bb3 - 3494126 - Updated call to getDownloadHeaders()

    Compare with previous version

  • added 1 commit

    • 6e74e20c - Specified return type for the method

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading