Problem/Motivation

locale.settings:translation.path is the last system path that's still in configuration after private and I think originally also public moved to settings.

It's also the last usage of the pretty weird system_check_directory function. With that done, we can deprecate that function without replacement.

Steps to reproduce

Proposed resolution

Do what we did for the private path setting, convert to Setting with fallback to config. #2170235: file_private_path should be in $settings, like file_public_path

Of course this is a bit different, this isn't a stream wrapper, but I'll see where it ends up.

Remaining tasks

Close #3073684: [pp-1] Deprecate system_check_directory() as outdated when this lands.

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

The configuration setting is deprecated and can no longer be changed in the UI. Set $settings['locale_translation_path'] = '/the/path' instead. The update will remove and notify about a customized value.

Issue fork drupal-3571593

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

berdir created an issue. See original summary.

berdir’s picture

Status: Active » Needs review

Got started with this. Works fairly well I think based on the tests.

berdir’s picture

The update path test deprecations are awkward.

I added a post update, but it still fails. The problem is arguably a bug in the current behavior, which is an actual path, and it's sites/default/files/translations. The problem is that in the test, public://translations resolves to the simpletest site path, so it's not the same and it's not cleaned up.

One option is we just unconditionally kill the old setting, then we could also possibly drop the runtime fallbacks. It doesn't really matter, it's just a cache really. We could display a message if it didn't match.

nicxvan’s picture

Is it that or is it the fixtures?

berdir’s picture

Not exactly sure what you mean with "that", but the point is that the new default path is dynamically adjusted to the current test-multisite-path while the one in the fixture is not. It wouldn't be a update of the static fixture but would need to dynamically set it up after the test setup.

Doable, but before going that path, I want to decide whether or not we even want to support or consider the old configuration.

nicxvan’s picture

Sorry by that I meant:

The problem is that in the test, public://translations resolves to the simpletest site path, so it's not the same and it's not cleaned up.

The failure I checked had the 10.3 fixture i searched through it and I think it had the paths config but I may have been mistaken.

berdir’s picture

StatusFileSize
new37.75 KB

Yes, it has the path config. The problem is that the expected new default path is now dynamic within a test and contains the test ID, we can not just update the static definition. We'd need to add something into \Drupal\FunctionalTests\Update\UpdatePathTestBase::installDrupal or so.

It's doable, but I think I'd prefer the alternative option, we just drop it and let the user know if they had a non-default value.

There typically aren't that many messages, not in the UI anyway on this page. This is how the output of that test looks like now:

berdir’s picture

StatusFileSize
new104.93 KB

That was the wrong file:

nicxvan’s picture

Would @gabor be the one to make that decision?

gábor hojtsy’s picture

Issue tags: +Needs release note

We've discussed this extensively in Slack. If there would be a method to provide this kind of feedback that is higher level than the message but is lower level than throwing an error from the update function, we should use that, but there is none. I agree that this is very rarely customized for highly specialized scenarios (eg. distributions or SaaS products using their own translation server, multisites optimizing for one shared directory to download translations, etc). They would still need to take note. The message in the update function will help. Also we need a release note. There is already a change record which may be good to copy into the release note snippet too? :) Otherwise IMHO look good from an interaction perspective.

berdir’s picture

Issue summary: View changes
berdir’s picture

Thanks for the feedback. I've made a suggestion for the release notes, which is identical to the CR.

andypost’s picture

Looks ready to go except of merge conflict

nicxvan’s picture

Status: Needs review » Needs work
Issue tags: -Needs release note

Got a suggestion that should solve the failures.

Release notes look good, I updated the cr as well.

Once this is green I think this is ready!

nicxvan’s picture

Issue summary: View changes
berdir’s picture

Status: Needs work » Needs review

Yes, that's been deprecated in the meantime.

nicxvan’s picture

Status: Needs review » Reviewed & tested by the community

Looks good!

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

Added a long comment about the update process. I think we should not clear the value if it does not match the default. And we should add a requirements error if the path is set in config after the update and TranslationsStream::basePath() is returning something different.

nicxvan’s picture

That is a pretty clever solution, we should do the same in the field purger service issue:

#2907780: Add a field purger service

alexpott’s picture

Actually we can use an update hook in the follow-up for main to tell people to update. We don't need to add a requirements hook here. That's what an update requirement is for :)

berdir’s picture

Status: Needs work » Needs review

Then I think this can go back to review, updated the update hook and "fixed" the update data to use the adjusted value so it matches in our update tests.

The default schema validator in development services will also complain about this.

nicxvan’s picture

This is a little messier in the implementation but it's much more BC friendly since we keep the custom value.

I think this addresses alexpott's comments!

RTBC again.

I reviewed all of the commits since it was set back to needs work and the full change again.

nicxvan’s picture

Status: Needs review » Reviewed & tested by the community

Whoops, meant to change status.

alexpott’s picture

Version: main » 11.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed 05ecfda70b1 to main and a7cbb9d8e33 to 11.x. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • alexpott committed a7cbb9d8 on 11.x
    task: #3571593 Deprecate translation.path config in favor of settings...

  • alexpott committed 05ecfda7 on main
    task: #3571593 Deprecate translation.path config in favor of settings...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.