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.
Comment | File | Size | Author |
---|---|---|---|
#49 | 1751348-locale-settings-49.patch | 18.62 KB | vijaycs85 |
#49 | 1751348-diff-47-49.txt | 880 bytes | vijaycs85 |
#47 | 1751348-locale-settings-47.patch | 17.93 KB | Gábor Hojtsy |
#42 | 1751348-locale-settings-41.patch | 18.88 KB | vijaycs85 |
#42 | 1751348-diff-37-41.txt | 2.21 KB | vijaycs85 |
Comments
Comment #1
larowlanTagging
Comment #2
penyaskitoComment #3
tobiasbWhich form is that?
Comment #4
Gábor HojtsyI think this might be about the locale file directory setting (form altered into the file config screen) and possibly about the default language (in a variable now) and cached number of languages (which is really a state value - which I've heard should have another system).
Comment #5
tobiasbComment #6
tobiasbhmm it seems, that the part of "locale file directory setting" / locale_form_system_file_system_settings_alter() is already done in #1496480: Convert file system settings to the new configuration system
Comment #7
sunComment #8
julien CreditAttribution: julien commentedhere is some changes only for the locale settings variables, haven't modified everything related to language module, so the tests fails.
maybe some variables needs to be reorganised in the yml.
there is also some tests in locale, that works with variable_get because it does provide a default_value, so the test disable a module and uninstall it, and check the variable_get value, and if it find the default_value then asserttrue, but in our case, those tests have to be modified, because the default values come on module enable i think (when it parse the yml again), not sure if it's right. see LocalUninstallTest.php line 99
Comment #9
andypostLet's see how many tests will be broken
Comment #10
julien CreditAttribution: julien commented8/14 locally, because it still need work.
Comment #12
tobiasbOne unnecessary whitespace
Comment #13
Gábor HojtsyNot being worked on, can be done after Dec 1st.
Comment #14
Gábor HojtsyWhy is it not taking the tag removal?
Comment #15
vijaycs85#8: drupal8-convert-locale-settings-to-configuration-system-1751348.patch queued for re-testing.
Comment #17
vijaycs85updating yml file changes.
Comment #19
BerdirThe leading / is wrong and this needs to have an empty default value and be calculated on demand if empty because conf_path() might be something else than sites/default.
Wondering if this is state, not config. Is this ever used/configured from the outside or just used/calculcated as needed?
This doesn't seem to be used?
Comment #20
gddThis is just a reroll right now.
This variable is also being added by #1496480: Convert file system settings to the new configuration system where it is set to 'public://translations' which I think is a good solution. I actually think we should pull it out of that issue and into this one, so I will do that in a followup.
Looking at the code it doesn't appear to be set anywhere outside this function, where it is always calculated, so putting it in state seems appropriate.
Comment #21
gddNow with actual patch.
Comment #23
gddSo... in looking at both issues, the implementation is far more complete in #1496480: Convert file system settings to the new configuration system so I'd rather leave it there and remove it from here. This patch actually needs quite a bit of work in addition to berdir's issues above. There are lots of missed variable calls that remain to be converted in it. Test run above canceled.
Comment #24
gddHere is a reworked version of this patch. It does the following:
- Converts the 'javascript' and 'plurals' arrays to state.
- Converts all values in locale.settings.yml to be properly formatted strings.
- Fully converts all other variables
- Removes two tests from LocaleUninstallTest. These tests only made sense in the context of a variable with a default value that got reset after locale module was uninstalled. In the current system, those variables simply disappear because the config file gets deleted, so I don't think the tests really make sense anymore.
As posted above it does not convert the translations file directory.
Tests should pass as far as I know.
Comment #25
BerdirThis looks good to me apart from the missing upgrade path :)
What's this?
Comment #26
gddI noticed that too but wasn't sure if I should remove it. However that's its only appearance in D7 or D8, so I removed it.
This patch adds upgrade path for the variables converted to config. It also removes part of the existing upgrade path which did straight variable renames. This no longer makes sense with these variables moving to config.
One thing I noticed in past patches is that there is no upgrade path for variables to state. This makes a certain sense but also seems weird. I didn't add that here since nobody else has. However even if the variables don't get upgraded it seems we *should* at least variable_del() the old variables maybe?
Comment #28
Berdir#26: 1751348-locale-settings-26.patch queued for re-testing.
Comment #29
BerdirNot exactly sure what we want to do with those. At the minimum, we need to use update_variable_set().
Or we might just want to convert it right to config()/state here.
Comment #30
gddThat's a good call, I just changed them to config there, and removed those variables from the update hook. That's the only change. No interdiff because I also merged HEAD.
Comment #31
gddComment #33
gdd#30: 1751348-locale-settings-29.patch queued for re-testing.
Comment #35
gdd#30: 1751348-locale-settings-29.patch queued for re-testing.
Comment #37
gddReroll
Comment #39
vijaycs85#37: 1751348-locale-settings-37.patch queued for re-testing.
Comment #41
gddThis upgrade path test is, for a change, not a random bot fail. While looking into it I found a couple more irregularities in upgrade path. New patch later.
Comment #42
vijaycs85Attached patch contains:
1 - $config variable change - from locale.settings to language.negotiation.
2 - language domain URL fix (protocol/port not allowed) in language upgrade.
It fixed test case failure in #37.
Comment #43
gddYup, that's what I found as well, the swapping of locale.settings and language.negotiation in a couple places.
I'm curious about this change. The test passes before the patch, shouldn't it pass after with no changes? Why do we have to change this line to make things work?
Comment #44
vijaycs85@heyrocker, I tried to set this URL with protocol and port manually at admin/config/regional/language/detection/url and got the validation error that we shouldn't have them. not sure when we got this validation in place, but removing of them did the trick.
Comment #45
gddVerified this change with Gabor so I think this is good to go.
Comment #46
Gábor HojtsyOk, slept a bit on this. Sorry for jumping in late. This test is supposed to ensure that prior settings for domains would migrate properly in the upgrade path. When this was added, the upgrade path definitely made sure to remove protocol and ports from the domain.
Drupal 7 allows protocol and ports but recent Drupal 7 versions were changed to not actually use the value. Drupal 8 does not allow for protocol and port, so it is more compatible.
See locale_update_8003() for where the setting is updated.
The patch should pass upgrade tests without removing this.
Comment #47
Gábor HojtsyReuploading with that hunk removed. the fail above was preceded by an "Undefined index: ca", so that should have been a warning sign that the issue is somewhere else. Eg. actually in the upgrade path(?).
Comment #49
vijaycs85Updating patch to get the $domains from config instead of variable. Though, it fixes the upgrade test issue locally, need to confirm the use of config() in hook_update_N.
Comment #50
Gábor HojtsyLooks like one of the ways to solve this, thanks! Although there is #1856972: config() isn't safe to use during minor updates if there's a change to configuration storage as @catch says there, other upgrade functions use config() too.
Comment #51
Dries CreditAttribution: Dries commentedCommitted to 8.x. Thanks!
Comment #52
andypostI filed follow-up regression #1919002: Upgrade to D8 broken when D7 has more then one language enabled
Probably this caused by config() usage #1856972: config() isn't safe to use during minor updates if there's a change to configuration storage
This points that this issue does not have upgrade path tests for the convertion