Problem/Motivation
file_directory_temp() is a procedural function in file.inc and contains some interesting logic. If there is no value set in config, it will call getOsTemporaryDirectory(), and if that isn't set, it will fall back to public://tmp/
It then sets this value in config.
Proposed resolution
Remove the need for the config system, and instead use Settings, just like the private file system path.
Provide BC for config set values, and use the fall backs as we currently do if not set in Settings. However, do not set config.
Remaining tasks
- Implement it.
- Find a way to trigger deprecations
- Add a requirements check if it is not set in settings.
- Make the file system temp dir settings form field read only, so users cannot update it (or just display it like private filesystem dir)
User interface changes
Users will no longer be able to set the temp directory from the file system settings form.
API changes
file_directory_temp() is deprecated.
Users are required to set a value for 'file_temp_path' in settings.php. E.g.:
$settings['file_temp_path'] = '/tmp';
Data model changes
Release notes snippet
The temporary file path is no longer stored in configuration, and is a setting in settings.php.
If your site is not using /tmp, you must update settings.php before running database updates.
Follow up to #3034072: Move file uri/scheme functions from file.inc and FileSystem to StreamWrapperManager
| Comment | File | Size | Author |
|---|---|---|---|
| #121 | 3039026-121-interdiff.txt | 3.57 KB | kim.pepper |
| #121 | 3039026-121.patch | 81.27 KB | kim.pepper |
| #117 | 3039026-117.patch | 80.86 KB | kim.pepper |
| #113 | 3039026-113-interdiff.txt | 976 bytes | kim.pepper |
| #113 | 3039026-113.patch | 80.7 KB | kim.pepper |
Comments
Comment #2
kim.pepperHere's an initial patch.
Comment #3
kim.pepperNeed to diff against 8.8.x branch now.
Comment #5
andypostMaybe it needs separate CR?
Otoh extending https://www.drupal.org/node/3006851 means to keep all FS lated changes easy searchable
Comment #6
jepster_Same here with Drupal 8.7.0 instead of 8.8.0.
It won't be released in Drupal 8.7.0. It will be released with 8.8.0 at earliest.
Returning "mixed" is really bad I think. It should be string|null. That also says the comment below.
Why are you adding this attribute comment? The object type is already known by the constructor comment.
There are 7 dependencies injected. Wouldn't it be possible to re-think them and maybe encapsulate wisely, so there will be fewer?
Please write 3 equal signs. Because that way the data type will be also checked.
Comment #7
kim.pepperFixes fails due to config changing in one request.
Re: #5 I've added a new change record https://www.drupal.org/node/3039255
Re: #6
Comment #8
dwwTotally out of scope, but since I'm seeing it... WTF? ;) What if you change your default scheme config between when you install and uninstall this thing? ;)
Should this method's name start with the verb "get", as in
getDefaultScheme()?"Gets and sets"... huh? ;) Does it get or set? If it takes no arguments, how is it setting anything? Weird API. Again, I'd rather have a verb in the function name.
Looking at the old file_directory_temp() implementation, I see it indeed does both, and perhaps untangling that is "out of scope". But if we're deprecating this and moving it into a "clean" service, isn't this the perfect time/issue to make this not so weird?
Is it fair to remove this @todo if we're still calling \Drupal::service for this? Don't we need to actually inject that service properly?
Comment #9
kim.pepperComment #10
dwwRe: #9, thanks!
1. Needs follow-up? ;) Those docs are seriously bad. We shouldn't be recommending any of this.
2. Great! Much better IMHO.
3. Hrm, yeah, I guess I'm just bothered that calling
getTempDirectory()has the side effect of (what should be)initializeTempDirectory()if it there's no temp dir configured. :( It's one thing to have a "get" method that offers a fallback if the thing you're trying to get isn't set. This seems like a bit of a different beast. I wonder if we should actually move all that code into a separateinitializeTempDirectory()method? But yeah, ifgetTempDirectory()callsinitializeTempDirectory()on demand, it's not really any better than what we have now. Not sure if there's a better place to callinitializeTempDirectory(). Maybe I should stop caring and call this Good Enough(tm). ;)4. Hrm, yeah, I see what you mean. That file is full of
\Drupal::service()already. Okay, I retract my concern -- out of scope, I guess.If it weren't for my lingering doubts about point 3, I'd call this RTBC. I guess someone else can do that. ;)
Thanks,
-Derek
p.s. #3038988: Remove support for empty destination in FileSystem::copy(), FileSystem::move() and FileSystem::saveData() calls file_default_scheme(), so if this lands first, that'll need a re-roll. If that lands first, this will need to fix that call site, too.
Comment #11
kim.pepperPostponed on #3038988: Remove support for empty destination in FileSystem::copy(), FileSystem::move() and FileSystem::saveData()
Comment #12
dwwSounds like a good plan to manage the re-roll dependencies.
Meanwhile, FYI: #8.1 is now at #3039296: Fix examples in hook_install() and hook_uninstall().
Cheers,
-Derek
Comment #13
kim.pepperComment #14
larowlanBlocker is in
Comment #15
kim.pepperRe-roll of #9
Comment #17
kim.pepperReplace additional uses of file_default_scheme().
Comment #18
claudiu.cristeaAssigned for review.
Comment #19
claudiu.cristeaThis should be 8.8.x.
Comment #20
kim.pepperRe-rolled and updated deprecation messages to 8.8.0.
Comment #21
dawehnerThe documentation for this class isn't really particularily helpful, maybe talking about what this interface does would be helpful.
s/and/an
Could we also mark this internal so this patch doesn't increase the API surface?
How about adding a
@ingroup file, so it is referenced in https://api.drupal.org/api/drupal/core%21includes%21file.inc/group/file/...I wonder whether we could use something like
assert($object instanceof ResourceIdentifier);Comment #22
kim.pepperThanks for the review @dawehner!
Comment #23
dawehnerHere is another place where we could use
assert()Comment #24
kim.pepperFixes #23
Comment #25
claudiu.cristeaExceeds 80 chars. Move "Use" one line up.
Should not end with period after "See {url}". There was a discussion here #3024461: Adopt consistent deprecation format for core and contrib deprecation messages.
It's weird that we do a "set" within a getter. However, casting $temporary_directory to
(string)seems superfluous to me as the variable is always a string.Why not injecting the new service?
If we had tested this, we would have detected the error. Tests are good :) The
$file_system_configis not set. Let's also test the deprecation.Let's test this too.
As we've touched this line, why still using the deprecated function?
There is assertFileExists() & assertFileNotExists().
assertNotEmpty()
The CR branch should be also incremented to 8.8,x.
Comment #26
vadim.hirbu commentedUpdated latest patch according latest comments.
Added interdiff file.
Comment #28
kim.pepperThese changes are all out of scope. You can only change things that are directly related to this issue.
Comment #29
kim.pepperRe #25
Also updated the CR.
Comment #31
kim.pepperFixes Directory test fails.
Comment #32
claudiu.cristeaThis is still not correct:
$this->fileSystemConfigwill be overridden with NULL just after exiting theif (...)block. It should be$file_system_config = \Drupal::service('file_system_config');. Unfortunately, the test is not catching this. Replace the assertion with:... and you will see the error. If you add the suggested lines in test, probably it should be a kernel test because involves also other services.
s/8.7.0/8.8.0
Comment #33
kim.pepperThanks @claudiu.cristea
Comment #34
berdirwhat are we going to do with this thing?
What's the plan now with this and #3047257: File system config should be container parameters? Woudl we keep this as public API, but move the tmp directory to a setting? Pretty sure there's already an issue for that, btw.
I find it interesting that an issue was opened to have a better example for hook install/uninstall due to that being problematic, but the actual implementation where it was copied from was not really discussed :)
I'm not sure the write part is even really necessary. We're dynamically writing nested folders anyway for the actual image styles with their nested paths and everything, why do we need to pre-create the styles folder?
somewhat strange that the "helper method" to get the config value is actually longer than getting it directly from config now :)
Comment #35
kim.pepperRe #34
Comment #36
kim.pepperI've closed #3047257: File system config should be container parameters in favour of implementing the settings changes here.
Comment #37
kim.pepperIf we remove getting the temporary directory from config, and use settings, we can move the logic to FileSystem service. If we also replace usages of getDefaultScheme with Settings::get('default_scheme') we don't need to add a new FileSystemConfig service. 🤘
Comment #38
berdir> If we also replace usages of getDefaultScheme with Settings::get('default_scheme') we don't need to add a new FileSystemConfig service.
Not quite sure about this part, since it's not actually environment-depending.
Also not quite sure yet how the BC for that setting would look like and if that really could be in FileSystem. I guess we could fall back to a non-injected config call?
Another thing to keep in mind is that using Settings means we can't write it back like do now, so there's a certain overhead of having to find it every time we access it. There are also issues like #2817677: Can't remove "Temporary Directoy" path where people are confused about that.
I really thought we had an existing issue about that, but couldn't find it. I did find some related issues:
Comment #39
kim.pepperHmm. Maybe we just replace file_default_scheme() with $config->get('default_scheme') and split that off to a separate issue.
Then its just adding getTempDirectory to the FileSystem service in this issue.
The code would then look like:
Is that too expensive to run each time? I think by removing the config->get() call we should see an improvement.
Comment #40
kim.pepperI started from scratch and just implemented the temporary directory part.
Comment #42
kim.pepperDiscussed with @Berdir and agreed we should be falling back to config. I've added a trigger_error to see what blows up.
Comment #44
kim.pepperRemoving the trigger_error for now to see if we have the right flow.
Comment #45
kim.pepperComment #47
kim.pepperFix tests in #44
Also updated the title as we are only dealing with file_directory_temp() in this issue.
Created #3049021: Deprecate file_default_scheme() and just use config
Comment #49
kim.pepperFixes remaining test.
Comment #50
kim.pepperUpdating IS
Comment #51
kim.pepperMake temp directory read-only in file system admin form.
Comment #53
kim.pepperAttempt to fix test in #51
Comment #54
jepster_@kim.pepper:
First of all: thanks for your contribution! :)
In core/lib/Drupal/Core/File/FileSystem.php the ConfigFactory was not injected, but taken via the service container. The dependency injection principle should be followed consistently, if you define a service via a service.yml file. I have implemented that.
In file_directory_temp() you have specified "mixed|null" as return type via the PHPDoc comment. The interface at core/lib/Drupal/Core/File/FileSystemInterface.php specifies a string here. "mixed" is always a trashy PHPDoc return type which is leading nowhere.
What I am not sure: The key-value array pairs should be formatted in columns. Your arrays are not formatted. E.g. for correct formatting:
Everything else looks okay to me. Please review.
Comment #55
berdirWe didn't do that on purpose, as you can see, everything explodes if you try that.
What we should do is better document *why* we don't do that. Because of the dependency issues and because it is only a BC layer, 9.x will then most likely remove that.
Comment #56
jepster_@Berdir: Looks like the dependency is not injected correctly on all necessary places. IMHO the dependency should be simply injected correctly. Instead of a lame comment, which is telling that we have been too dump to do it correctly.
Comment #57
kim.pepperI have added the following extra comments to explain why it cannot be injected.
(Interdiff from #53)
Comment #58
kim.pepperOops ,wrong interdiff file.
Comment #59
kim.pepperComment #60
jibranThis is not defined in
default.settings.phpand I'm unable to find the string 'file_temp_path' anywhere in the HEAD. If we are adding a new settings key then let's add documentation and sample default value.Comment #61
kim.pepperAdds documentation and example setting to default.settings.php
Comment #62
jibranThanks, for fixing the feedback. Let's update the change notice with this info as well.
s/we/be
Comment #63
kim.pepperFixes #62
Comment #64
jibranThis looks ready IMO. Only needs the change notice update as per #62.
Comment #65
kim.pepperUpdated CR and IS
Comment #66
alexpottI'm not sure about the word private starting this off. It makes it sound as though it is for private files. I think the important details are that typically this does not need to be set and should not be accessible to the web server.
This should trigger a deprecation error. We also need to remove path.temporary from the default config. And we probably need a system_requirements() to telling people to add a line to settings.php if they've customised it.
We also can provide an upgrade path and remove system.file:path.temporary is it matches the OS determined default.
Comment #67
andypost+1 to get rid of config setting, moreover instead of so many "fallbacks" I'd prefer
php://temphttps://www.php.net/manual/en/wrappers.php.php#wrappers.php.memorySo the only difference against private files will be presence of fallback to
php://temp- easy to undeestand and just one option in checklist - "temp files exists in settings"I wonder why so many "fallbacks" if the approach should be same for every stream wrapper
Comment #68
kim.pepperRe: #66
I'm not entirely sure what to do with this in install.core.inc install_base_system():
I need to remove it to avoid the deprecation being triggered, but it's obviously there for a reason?!
Comment #69
kim.pepperRe: #67 that sounds like an issue for swapping out \Drupal\Component\FileSystem\FileSystem::getOsTemporaryDirectory() ?
Comment #71
kim.pepperRemoved 'path.temporary' config from the 'system.file' config in core/tests/fixtures/config_install/testing_config_install.tar.gz
Comment #73
kim.pepperUpdates core/tests/fixtures/config_install/multilingual.tar.gz
Comment #75
kim.pepperI think some of the remaining fails are due to not setting the temp directory per test #68.2 Not sure how we get around that?
Comment #76
YurkinPark commentedJust wanna check what is changed
Comment #78
andypost@kim.pepper Re #69 sounds like and looks like separate issue to remove component cos regexp stuff not so much related to filesystem, so filed #3063704: Deprecate \Drupal\Component\FileSystem\FileSystem::getOsTemporaryDirectory() and replace with sys_get_temp_dir()
Comment #79
berdirnitpick: empty line added between uses.
new wording is removed from drupal:9.0.0 I believe?
I suppose what we need to do instead is write this value to settings.php, which should be writable during the installer?
Should we in that case also be extra careful and add a Drupal::hasContainer() check and skip the fallback if not?
Yes, something like this test we'd also need in the installer itself, for test that are testing the installer.
Interesting. Considering that we are deprecating this, seems like we should also remove/deprecate this migration?
Maybe we can be a bit more helpful here? Like, we could actually print out the exact statement that you need to add? And in case it matches the default value that we'd get, we could even say it can be removed safely?
The !empty() isn't necessary anymore, we can just do if (Settings::get()).
This part is a bit tricky however, in that existing processes might rely on setting this in settings.php and we would now break it, without BC. That said, installer is technically excluded from BC, so this is probably too? But even we decide to explicitly drop it, we could be "nice" and throw an exception if we see that the value is set?
Ah, so you're removing it here, which I guess means we don't have to check for it being equal in the requirements hook, fair :)
comment still uses the deprecated function nime, maybe we could add a covers annotation and just use something like "Tests default temporary path" or so?
Not 100% sure whether kernel tests have or don't have a temporary path set, though. Maybe this code is a left-over from when it wasn't a kernel test, maybe it actually was set somewhere and we should convert that to settings to avoid fun race conditions?
lies!
that was copied from private://, but it doesn't apply here.
Comment #80
kim.pepperThanks for the thorough review @Berdir!
I also had to add @tempnam as it was throwing notices in php 7.1. Not sure whether that's a side effect of this change or not?
Comment #81
kim.pepperOoops. Pasted something in accidentally.
Comment #82
berdirI guess if there's a test there's also a migration defined for this somewhere?
Comment #83
berdir3. Would have assumed in the same place, not sure?
5. That was just a reference to 3, that we need to do something like that there.
10. We have quite a few examples of kernel tests with @covers stuff too, for example \Drupal\KernelTests\Core\Path\AliasStorageTest. My understanding is that it specifically for cases where a test calls multiple things, because then code coverage knows only to mark those parts as covered and not any other code that we happen to call but don't assert for.
Comment #84
kim.pepperNo idea how those work sorry!
Comment #86
berdirI suspect this is caused by having an invalid temporary directory configuration, so we shouldn't add @ but figure out why that happens.
Comment #87
dawehnerJust a quick nitpick:
Nitpick: This should be "8.0.0" to "8.8.0"
In doubt we should at least document why this might fail
Comment #88
zviryatko commentedDid a little research about the history of this method and found that it was added 14 years ago as a fix for Win2000 and PHP 5.0.5-dev, probably it's a legacy that can be removed. Initial issue #26249 and it wasn't changed but only moved around.
Comment #89
dwwAhhh, strolling down memory lane. Remember when "change records" were like comment #26249-29: use upload_tmp_dir as default for FILE_DIRECTORY_TEMP and when all of contrib lived in a single CVS repo that we'd grep through when looking for what we'd break with a given API change? ;)
Comment #90
berdirFound some problems that I'm attempting to fix, we'll see how that goes.
* The updated config tar.gz files had the files inside a "." folder, had to re-create them with e.g.
tar -czvf ../testing_config_install.tar.gz ** The update problem was that the filled dump had /tmp as the configured temp directory, that was unset and then it fell back to default temp folder set up by the test environment, but that wasn't created because it doesn't run with that path in system_requirements() before the updates (or something like that, I suppose). The non-filled dumps probably don't have that set, so it always uses the fallback. I'm not too happy about how this is done now, but not sure where else it should be.
* I also tested to add back the removed code in install.core.inc, but I think the change in #76 is a valid alternative that seems more consistent with the other directories, so leaving that out for now. We might need to make sure this doesn't introduce random fails or something like that.
Something I didn't adjust yet but I think we should is also check the file_temp_path setting in system_update_8801(), because that allows sites to set that already *before* they update (e.g. dynamically based on environment variables like that's common on hosting platforms like platform.sh, then the update will already remove the old configuration if that was set. Likely even remove it if any value is set, although that will make an update test tricky, as this is always set in tests and we can't test that it is kept...
Comment #91
berdirOops.
Comment #92
kim.pepperThanks for cleaning up the mess @Berdir!
Still need to address comments in #87
Comment #93
kim.pepperAddresses feedback in #87 and also updates deprecation message format.
Comment #94
berdirno need to update this to 8.8.0?
this deprecation on the other hand should be 8.8.0 as it is a new deprecation.
Since we don't even check for a configured value if settings is set, I think we should do what I commented. If any settings value is set, drop the configuration key in the update function.
We also need a test for this. As I wrote, if we also drop it when any settings value is set then it might be tricky to test a negative case when it's not deleted. But we could at least test the deletion, and separately, also test the requirements message if it is set?
Not quite sure about this part yet. Maybe it would need the same logic as the update function? migrate the old value only if it doesn't match the default temp path or configured settings path, which would then trigger the deprecation? Then again, what's even the point of migrating this, either it is the system default, or if not, then it's likely actually not correct for the D8 site as it is installed in a different location.
my comment doesn't make too much sense yet, it's not (yet) configured.. maybe the "default temp directory" and explicitly mention that the configured one might be unset during the update?
Comment #95
kim.pepperComment #96
berdir> Updated the update hook. I might need some direction on the best way to add a test for this.
The "delete" case should be pretty easy, add an assertion to the update filled test to ensure that the config key is no longer set after the update. And possibly check if it is set before, but we might need to directly access the database for that.
Comment #97
alexpott.
This logic needs testing.
->save(TRUE);
Comment #98
kim.pepperRe: #97
Still need to address #96
Comment #100
alexpottWe can disable schema checking for the tests affected tests.
Comment #101
berdirIn regards to the migration, do I understand that correctly that the temp directory there is only set to find files in the temporary folder and deal with that? In that case, we should keep that? (there doesn't seem to be any explicit test coverage for it, though?)
Comment #102
mikelutzBack in the day, we didn't migrate temporary files. in #2394157: Update the EntityFile destination to handle temporary files we started to. I haven't pieced together the entire history of it all, but it seems that the temporary directory in the d6 fixture is set to /files/temp in the variables table, but the temporary file in the fixture has a path of /tmp/xxx. This was all before the fixtures as we know them too.. From what I can gather, at that point, the mismatch would cause the system to decide the temporary file wasn't there (simulating it being deleted by the filesystem) and skip migrating it in the initial migration in the test. Back then the update line explicitly set the variable to '/tmp' to match the testfile, and the test tested that the temporary file was migrated in the second runthrough.
This lead to an issue when the migration was happening on the same server, and the source and destination temporary directories were the same, and the migration was trying to save the file over itself. We fixed this in #2405337: EntityFile destination doesn't handle temporary files when the source and destination are the same and tested it by setting the temporary directory of the test run to /tmp too. This caused failures, which were fixed in #2417549: Drupal\migrate_drupal\Tests\d6\MigrateFileTest fail in MigrateTestBase by adding a temporary file to the fixture on the fly that matched the temporary directory of the test run(usinging simpletests TestBase::getTempFilesDirectory(). This set us on the path of setting the d7 fixture temp directory variable to match the test run's temp directory on the fly in this test. In #2684141: Convert migrate kernel tests to KernelTestBaseTNG The test moved from simpletest to phpunit, and TestBase::getTempFilesDirectory became file_directory_temp().
All of which fun stuff leads up to #2729369: Remove support for migrating temporary files where we hard code ignoring files with a path that start with /tmp in the d6 file source, and no longer migrate temporary files at all. There used to be an assertion that the temporary file was migrated on the second run after setting the variable correctly, but that was removed, making the entire fixture update to change the source site's temporary directory completely useless (it should have been removed in that issue too). (as a side note, why 2729369 skips files whose path starts with /tmp rather than files whose status is 0, or at least whose file path starts with the source site's temp directory variable value, and why the file_url process plugin still processes temporary file uris is completely beyond me, and probably deserves a follow-up)
TLDR; This is fine. The update to the variable table is no longer necessary, (and was done incorrectly anyway)
Comment #103
kim.pepperThis addresses the fails in #98 Not sure why the array order changed? The arrays have equal values otherwise.
Re: #100 oh, didn't know about that! I've removed the schema and added that to the test.
Re #96 adds a test that covers most cases. Not sure how I can mock out \Drupal\Component\FileSystem\FileSystem::getOsTemporaryDirectory() inside that method. I guess that's a problem with using static methods?
Comment #105
kim.pepperHmm. Removing the schema seemed to blow up a few things.
Comment #106
berdirI think we can't remove the schema until the key is fully removed, the update only conditionally removes it and I guess the update tests that didn't fail before also didn't actually unset it.
Although I'm wondering what the value is then, maybe it's empty, and we could check for empty too and remove that as well? Doesn't change that there are cases when it needs to remain. and we should only remove the schema when we remove the BC layer?
So apparently here we still assert that the configuration setting is migrated?
Was looking for it in file.module before, but it's obviously in system.
As commented before, I believe migrating this doesn't make sense at all, files/temp obviously doesn't make much sense, it's definitely not going to be that on D8, seems like it would be much better to just use whatever D8 decided to use?
Comment #107
kim.pepperOK. I reverted removing the schema, and removed the migration of that config and updated the test. Let's see how this goes.
Comment #108
mikelutzSigning off on the latest migration changes. I agree that there is no reason to migrate that variable.
Comment #109
berdirinconsistent deprecation message: will be vs is.
for reviewers: This part is now instead handled in FunctionalTestSetupTrait, by writing the value to settings.php, like we do public/private, which is much cleaner.
another will be that should be is removed from.
I didn't see an update function that's over 80 characters, I assume the limit applies here too. I think it is OK to be less specific in the description, maybe say remove if redundant or something like that?
Also, the change record should recommend to set the replacement (if customized) in settings.php before running updates, then it's already getting cleaned up :)
I thought this has to be deprecated too, but apparently not yet :) and doesn't matter if it will be as this is a legacy test anyway.
not needed anymore.
this overlaps a bit with the requirements test, which also asserts that message, not quite sure if we ned both but also doesn't hurt.
The other two methods here aren't deprecated, so not sure if they are legacy or not. Maybe only this method should have @group legacy? That is supported.
note to reviewers: the config exports are updated to remove the deprecated key as that would otherwise result in deprecation warnings.
Comment #110
andypostNew setting could use @see to os default component
Why update hook used instead of post update one?
Comment #111
kim.pepperRe #109
Re #110
Comment #113
kim.pepperOops. Missed updating one deprecation test.
Comment #114
berdirI think this is ready, I did several full reviews of this. I worked a bit on it as well and fixed some tests, but that was already several iterations ago. (interdiff there is large, but only because I had to re-create the config archives)
Comment #115
andypostIt still needs follow-up for #88
Comment #116
berdir@andypost: Isn't that comment about the component method for which you already created an issue? #3063704: Deprecate \Drupal\Component\FileSystem\FileSystem::getOsTemporaryDirectory() and replace with sys_get_temp_dir()
Comment #117
kim.pepperRe-roll after #3035312: Move file_scan_directory() to file_system service
Comment #118
catch.
How exactly do you remove the dead configuration apart from editing the file directly or using drush?
I was expecting the following logic:
1. If set in settings, do nothing.
2. If only set in config, but matching system default, do nothing - since no change when it's removed.
3. If only set in config, but not matching system default, then warn with instructions to add the same value to $settings.
Then Drupal 9 can have an update to remove the old config key, all we need prior to that is people to take the decision to rely on system default or put it in $settings.
Comment #119
berdirWe already have an update function that removes it if it either matches the system default or there is a settings, so I think 1 and 2 are already kind of covered? Not quite sure why we again check if it it matches the default.
Comment #120
catchOK I see the update now, that helps to reduce the number of people who'll see the message, but the logic in system_requirements() still feels off - I'd think we'd at least want to check if the $settings key is there before telling people to add it for example. If someone sees the message, adds the settings key, they'll get an identical message as it is at the moment.
Comment #121
kim.pepperGood point! I've added a check for the setting in hook_requirements, and a test.
Comment #122
kim.pepperI think this is safe to move back to RTBC as it was a small change requested by @catch.
Comment #123
catchThis is good clean-up. Thanks @andypost for opening #3063704: Deprecate \Drupal\Component\FileSystem\FileSystem::getOsTemporaryDirectory() and replace with sys_get_temp_dir() would also be great to remove it completely if we can!
Committed f4c9f6e and pushed to 8.8.x. Thanks!
Comment #125
catchComment #126
kim.pepperI've published the change record. Thanks!
Comment #128
larowlanComment #129
daften commentedShouldn't there be a CR to show this change:
$config['system.file']['path']['temporary'] = 'foo/bar';
to
$settings['file_temp_path'] = 'foo/bar';
At least a more explicit CR than the current one.
Comment #130
berdirI added the old value as well to the message, seems fairly clear to me otherwise.