The theme uses a deprecated constant (FILE_CREATE_DIRECTORY)

Created on 13 June 2023, over 1 year ago
Updated 8 August 2023, over 1 year ago

Problem/Motivation

constant FILE_CREATE_DIRECTORY is deprecated.

🐛 Bug report
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

🇮🇳India Harshita mehra

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Harshita mehra
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India Harshita mehra

    I have uploaded a patch for the issue.
    Please review.
    Thanks!

  • Hi @Harshita mehna,
    Verified the patch it's cleanly applied.

  • Status changed to RTBC over 1 year ago
  • Status changed to Closed: works as designed over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    Since the code first checks the Drupal version, that is fine.

    if (((int) \Drupal::VERSION) < 9) {
      if (file_prepare_directory($path, FILE_CREATE_DIRECTORY) && !file_exists($path)) {
        file_copy($file, $path);
      }
      $images = file_scan_directory($themeLink . '/content/images', '/.*\.jpg|jpeg|gif|png|pdf|doc|zip|rar|docx|7zip|txt|rtf|odt|7z|ods$/');
      $videos = file_scan_directory($themeLink . '/video', '/.*\.mp4$/');
    }
    

    It does not use that constant in Drupal 9.

Production build 0.71.5 2024