Closed (outdated)
Project:
Drupal core
Version:
7.x-dev
Component:
file system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
5 Oct 2010 at 04:19 UTC
Updated:
20 Mar 2020 at 16:52 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dwwActually, it's not just the temp dir setting. There's also 'file_directory_path'. So, we need:
A) Migrate 'file_directory_temp' to 'file_temporary_path'. Delete 'file_directory_temp'
B) Based on 'file_downloads' migrate 'file_directory_path' to 'file_public_path' or 'file_private_path' as appropriate. Delete 'file_directory_path'.
C) Migrate 'file_downloads' to 'file_default_scheme'. Delete 'file_downloads'.
Comment #2
dwwNope, I was right the first time. ;) system_update_7034() handles B and C. I'll just add A to that. One sec, I'll roll a patch.
Comment #3
dwwHere's a test for the bug. This should have 2 failures for these two assertions:
Patch with the same test and a fix coming up next. Just want to demo that the test finds the bug currently in HEAD.
Comment #4
dwwThis one *should* pass, except for the bug at #930122: Regression: temp directory handling broken by confusion between file_directory_temp and file_temporary_path. ;) B/c of that, the 'file_directory_temp' variable is automatically set to the system default (e.g. /tmp) during the upgrade process, so we can't actually see that the upgrade path removed the bogus variable.
Once #930122 lands, this patch should pass all tests.
Comment #6
dww#4: 931736-4.file_directory_temp.patch queued for re-testing.
Comment #7
dwwretesting now that #930122: Regression: temp directory handling broken by confusion between file_directory_temp and file_temporary_path is in...
Comment #8
dwwDamn bot. http://qa.drupal.org/pifr/test/95039 says the patch passed all tests, but it's not updating the issue. :(
Here's #4 again in the vain hope that the bot actually shows us green in here.
Comment #9
chx commentedDrupal 7 bogus, eh? Nice test, good fix.
Comment #10
tom_o_t commented#8: 931736-4.file_directory_temp.patch queued for re-testing.
Comment #11
webchickWe need to pull this into a separate update function now that we support HEAD-to-HEAD upgrades.
Comment #12
dwwComment #13
tobiasbplease remove
debug(variable_get('file_directory_temp', NULL));Comment #14
webchickThanks. Committed to HEAD, minus the debug() :)
Comment #15
gábor hojtsyThis pretty much overwrites whatever freshly installed Drupal 7 sites had in their temporary directory setup. Drupal was supposed to provide update functions "like a stable version" since it became beta, so I think it would have been better to form this update as:
Otherwise as the current code stands, it overwrites the existing D7 setting with a default even if the D6 setting was never there. I think this needs a fix.
Comment #16
dwwYeah, I guess that's a good move. Except we always want to delete the dead variable.
Comment #18
dwwAhh right, hurray for the test I wrote. I believe the proposal in #15 will fail because by the time we're hitting this code, the D7 variable is already set due to the slightly wonky way it's being initialized in the code. So, there's always going to be a D7 value (even if it wasn't set by a site admin), which means that what Gabor proposes in #15 is (I believe) doomed. We'll never migrate the D6 value that way.
It might be possible to duplicate the code that sets the default value, and compare the D7 variable to what we think is the default, and only clobber the D7 value if:
- The D6 value exists
- The D7 value is the same as the default
But even that is questionable...
Anyway, I have no time for this now. If someone else wants to take a stab, knock yourselves out. ;)
p.s. This update already shipped in 7.0-rc1. So the people Gabor is concerned about, the HEAD 2 HEAD folks, have probably already been nailed by it. I'd strongly suggest moving this back to fixed and being done with it.