When saving the Privacy and Imprint URIs as relative URIs (e.g. '/privacy'), they are automatically converted to a system URI (e.g. '/node/25/').

The problem is that the system URI is saved to config, which could be an issue if a privacy page is represented by different nodes across environments (e.g. '/node/136/' instead of '/node/25/').

I propose the following: When checking if the relative URI is resolvable, save relative URIs in config as entered by the user. But do not convert them to the system URI.

Thank you.

Remaining steps (see #13):
0. Explain the change. What happened before and what happens now? How are the values handled and saved?

1. Add tests to ensure this works as expected for all possible cases of input, like for example:
- Drupal paths: /xyz (existing and not existing)
- Drupal paths:
- External URLs: https://xyz.com/123
- Other (non-existing) protocols: example:// and crap like "test123" (without leading slash)
- Did I forget something?

If we already have tests for this, please ensure all these cases are tested for their expected result

2. Ensure we have an update path here for existing values. What is expected to happen for existing values? What happens if a user re-saved the form with the old values?

3. Check for possible side effects where these values are used and write tests for these

4. Ensure this works like it's expected in Drupal and for example known from menu items etc.

Issue fork cookies-3303681

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

markdc created an issue. See original summary.

markdc’s picture

Issue summary: View changes

gilmord made their first commit to this issue’s fork.

gilmord’s picture

Status: Active » Needs review

Agree, dependency on content URI is hell on multi-environment set-ups.
Removed alias transformations in the MR, the same approach we can see in the core "Default front page" in the "Basic site settings" configuration form.

gilmord’s picture

Status: Needs review » Needs work

Checking why the tests have failed

gilmord’s picture

Looks like it comes from facebook_pixel submodule, I do not think it was affected by the changes

gilmord’s picture

Created and empty MR to trigger test (the only option for not project maintainers)
I want to check if it fails on 1.0.x or this facebook_pixel failed tests are really related to the changes in this issue.

gilmord’s picture

Status: Needs work » Needs review

Clean MR with no changes on 1.0.x branch also failed the same tests, I can assume this is a problem in the 1.0.x and not in this task.

markdc’s picture

#4 works. Thanks so much!

anybody’s picture

Status: Needs review » Needs work

Thank you for your work on this @gilmord!
Indeed, the failing tests are unrelated and are caused by: #3250126: Submodule dependencies are ignored if composer.json present in parent module (only in issue fork test runs!)

For this to be merged, we need to take the following steps:
0. Explain the change. What happened before and what happens now? How are the values handled and saved?

1. Add tests to ensure this works as expected for all possible cases of input, like for example:
- Drupal paths: /xyz (existing and not existing)
- Drupal paths:
- External URLs: https://xyz.com/123
- Other (non-existing) protocols: example:// and crap like "test123" (without leading slash)
- Did I forget something?

If we already have tests for this, please ensure all these cases are tested for their expected result

2. Ensure we have an update path here for existing values. What is expected to happen for existing values? What happens if a user re-saved the form with the old values?

3. Check for possible side effects where these values are used and write tests for these

4. Ensure this works like it's expected in Drupal and for example known from menu items etc.

I think we still have a way to go here, but this is also a good chance to make the module better tested and for standardization!

anybody’s picture

Issue summary: View changes
anybody’s picture

Version: 1.0.x-dev » 1.1.x-dev
anybody’s picture

Title: Save relative URIs to config » [2.x] Save relative URIs to config

We should make this switch with 2.x

anybody’s picture

Title: [2.x] Save relative URIs to config » [PP-2.x] Save relative URIs to config
Status: Needs work » Postponed
anybody’s picture

Title: [PP-2.x] Save relative URIs to config » [2.x] Save relative URIs to config
Version: 1.1.x-dev » 2.x-dev
Status: Postponed » Active

Hey ho, let's go! 2.x branch was recently created. Please help to implement this or if you're not a developer, please sponsor some development hours.

_shy made their first commit to this issue’s fork.

_shy changed the visibility of the branch 2.x to hidden.

_shy’s picture

Created a new branch and PR for 2.x version.