Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Part of #1775842: [meta] Convert all variables to state and/or config systems meta issue
Variables to convert:
file_chmod_directory
file_chmod_file
file_default_scheme
file_public_path
file_private_path
file_temporary_path
Comment | File | Size | Author |
---|---|---|---|
#48 | 1799504-convert_system_file_related_variables_to_CMI-48.patch | 44.07 KB | Cameron Tod |
#48 | interdiff.txt | 282 bytes | Cameron Tod |
#47 | 1799504-convert_system_file_related_variables_to_CMI-47.patch | 44.07 KB | Cameron Tod |
#47 | interdiff.txt | 3.81 KB | Cameron Tod |
#46 | 1799504-convert_system_file_related_variables_to_CMI.patch | 44.03 KB | andyceo |
Comments
Comment #1
andreiashu CreditAttribution: andreiashu commentedupdating title
Comment #2
andreiashu CreditAttribution: andreiashu commentedComment #4
andreiashu CreditAttribution: andreiashu commentedI think the test bot failed because of: c6bfd262e22778f3681118bd920bcebef7fc515f which was reverted recently.
Retest
Comment #5
andreiashu CreditAttribution: andreiashu commented#2: 1799504_file_chmod_1.patch queued for re-testing.
Comment #7
andreiashu CreditAttribution: andreiashu commentedok I was wrong. will look into why the installer fails a bit later
Comment #8
simeShould handle:
file_chmod_directory
file_chmod_file
file_default_scheme
In system.file.yml rather than system.site.yml
Comment #9
simeIssue now covers all these variables:
file_chmod_directory
file_chmod_file
file_default_scheme
file_public_path
file_private_path
file_temporary_path
Latest patch attached, but not complete. Todo:
-- convert file_*_path variables
-- update system_file_system_settings() to use system_config_form and provide a submit handler.
Comment #10
simeTODO:
1) Update
system_file_system_settings()
to usesystem_config_form()
and provide a submit handler.2) Some settings uses conf_path() to define the default. I do not know how to define this in the yml file. I am currently doing:
Comment #12
simeI was apparently unable to do "file mode" as a octal in the YAML file. So I used integers.
There are still errors in the installation.
Comment #13
simeConfiguration should set temporary file directory as NULL
Comment #15
simeFixed install hook conflict.
Comment #17
simeYay, got past the installer. Working on the system form.
Comment #18
simeI should probably take ownership of the issue to avoid confusion.
Comment #19
simeThe system settings form is done, not all tests are passing though.
Comment #20
simeMy local tests against an 8.x branch are giving me fails so going to see what the testbot says.
Comment #22
simeFixed up ->drupalGetTestFiles()
Comment #24
simeOK, 1 exception left. I do not know how to prevent it properly. It occurs in
MTimeProtectedFileStorageTest.php
in thetestSecurity()
method.I do not know why
config('system.file')->get('path.public')
is returning nothing when it is working fine in other tests. Also these PHPStorage tests are badly broken for me whereas the testbot shows only one exception.Looking at the code, the old code uses a variable get and doesn't care much if it needs to grab a default value comprised of
conf_path() . /files
, so the new patch *might* be appropriate, and replaces the above line with:Comment #25
simeOtherwise, this is pretty close... unassigning myself, but will keep an eye on it.
Comment #27
simeLooks like #22 is the best effort so far.
Comment #28
andreiashu CreditAttribution: andreiashu commentedPatch form #22 works fine for me and all PHPStorage tests are green so retesting
Comment #29
andreiashu CreditAttribution: andreiashu commented#22: drupal-system_file_settings-1799504-22.patch queued for re-testing.
Comment #30
Dave ReidThis looks perfectly sane except for the removal of file_default_schema(), which could be changed to be a wrapper for config(), much like file_directory_temp(). Let's please revert those removals of file_default_schema() in the name of DX.
This should use file_default_scheme() instead.
This should just be using
return file_directory_temp()
as a cleanup.Comment #31
andreiashu CreditAttribution: andreiashu commentedThanks Simon, patch from #22 is now green. Can someone review and RTBC please?
Credits for the patch should go to Simon please
Comment #32
Dave ReidI guess from a security perspective, are the following comments preserved in the exported config files? Otherwise I could see people trying to manually change these values to '0775' and things not working as expected.
Comment #33
andreiashu CreditAttribution: andreiashu commented@Dave: oops posted at the same time.
will amend
Comment #34
Dave Reidheyrocker confirms comments are not preserved, so based on #32 alone I need to mark this as needs work.
Comment #35
andreiashu CreditAttribution: andreiashu commentedAttached patch a per Dave's suggestions in #30 and #34
Comment #36
andreiashu CreditAttribution: andreiashu commentedoops. Ignore previous patch, I need to use file_default_scheme() in all places where we were using config directly...
new patch soon to come
Comment #37
Dave ReidA little confused why we can't actually use octal in YAML? http://trac.symfony-project.org/ticket/7067 seems it was fixed three years ago?
Comment #38
andreiashu CreditAttribution: andreiashu commentedPatch rerolled and updated per Dave's review. If we get green tests I'll attach another one with the octal values
Comment #39
andreiashu CreditAttribution: andreiashu commentedThis one is with octal in YAML file
Comment #41
andreiashu CreditAttribution: andreiashu commentedpatch from #39 had the perms as strings in the config file.
Attached patch has proper octal values in config this time
Comment #43
andreiashu CreditAttribution: andreiashu commentedrerolled
Comment #44
andyceo CreditAttribution: andyceo commented#43: drupal-system_file_settings-1799504-43.patch queued for re-testing.
Comment #46
andyceo CreditAttribution: andyceo commentedRe-roll of patch in #43 comment.
Comment #47
Cameron Tod CreditAttribution: Cameron Tod commentedReroll for current head.
Comment #48
Cameron Tod CreditAttribution: Cameron Tod commentedChanging octals back to strings after a discussion here at the London drop-in sprint.
Comment #50
Cameron Tod CreditAttribution: Cameron Tod commented#48: 1799504-convert_system_file_related_variables_to_CMI-48.patch queued for re-testing.
Comment #52
ruth_delattre CreditAttribution: ruth_delattre commentedComment #53
ruth_delattre CreditAttribution: ruth_delattre commentedComment #54
pfrenssenWhen I apply this patch and try to install Drupal using the Standard profile through the interface I get the following error:
Comment #55
pfrenssenThis is unfortunately a duplicate of #1496480: Convert file system settings to the new configuration system :(
I'll propose in the original issue that commit credit is given to the people that worked on it here so that the hard work done is not entirely lost.
Comment #55.0
pfrenssenUpdated issue summary to include all variables.