I think originally introduced in #551658: Figure out what to do about new private/public file separation, we have 'file_temporary_path' as the variable and setting form element and such (to be consistent with 'file_public_path' and 'file_private_path', etc). However, the helper function to give you the default value for this variable is still called file_directory_temp(). Sadly, I didn't notice this until the 11th hour of the 7.0-beta1 release, so it's too late to change that API. However, we should rename this function in D8 to avoid a DX-WTF.

Comments

dww’s picture

Version: 7.x-dev » 8.x-dev

Whoops, I meant this to be a D8 followup. ;)

dww’s picture

Guess these are the preferred tags. ;)

mlncn’s picture

Subscribe. :-) Awaiting D8!

aaron’s picture

subscribe

pillarsdotnet’s picture

So do we want to rename the variable to match the function, or do we want to rename the function to match the variable?

pillarsdotnet’s picture

pillarsdotnet’s picture

pillarsdotnet’s picture

pillarsdotnet’s picture

traviscarden’s picture

jhedstrom’s picture

Version: 8.0.x-dev » 9.x-dev
Issue summary: View changes
Status: Needs review » Postponed
Issue tags: +Needs reroll

Probably needs to wait until 9.

catch’s picture

Version: 9.x-dev » 8.1.x-dev

https://api.drupal.org/api/drupal/core%21includes%21file.inc/function/fi...

We could move file_direcotry_temp() to a service method in 8.x, and potentially rename the config key with a bc layer too.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

berdir’s picture

Status: Postponed » Active

Unpostponing, don't fully understand the problem here, but we do need a new place and name for this function anyway and it can't be FileSystem due to its dependency on the configuration system.

See also #3034072-3: Move file uri/scheme functions from file.inc and FileSystem to StreamWrapperManager (comment #3)

kim.pepper’s picture

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

quietone’s picture

Since file_directory_temp() has been deprecated it seems likely that this can be closed as outdated.

First check where file_directory_temp is used.

$ grep -ri file_directory_temp core
core/modules/file/src/Plugin/migrate/source/d6/File.php:    $this->tempFilePath = $this->variableGet('file_directory_temp', '/tmp') . '/';
core/modules/migrate_drupal/tests/fixtures/drupal6.php:  'name' => 'file_directory_temp',
core/modules/user/src/Plugin/migrate/source/d6/UserPictureFile.php:    $this->tempFilePath = $this->variableGet('file_directory_temp', '/tmp') . '/';
core/lib/Drupal/Core/Database/Driver/sqlite/Install/Tasks.php:        // We cannot use file_directory_temp() here because we haven't yet

Three of the four occurrences are in the migration system, referring to a Drupal 6 source database, so those are correct and remain unchanged. The other is in a comment in sqlite/Install/Tasks.php. The full comment is

        // We cannot use file_directory_temp() here because we haven't yet
        // successfully connected to the database.

and since it is referring to a now removed function it should be removed. Removing that is not part of this issue, that can be done in a followup to #3039026: Deprecate file_directory_temp() and move to FileSystem service. But it does mean that there is the work here is outdated.

quietone’s picture

Status: Active » Closed (outdated)
Issue tags: +Bug Smash Initiative
Related issues: +#3157370: Modify comment referring to file_directory_temp()

Created a followup to remove the comment referring to file_directory_temp(). #3157370: Modify comment referring to file_directory_temp().

Adding BugSmash Initiative tag and closing as outdated, because of #3039026: Deprecate file_directory_temp() and move to FileSystem service.

Thanks to dww for the report and to pillarsdotnet for creating a patch.